SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Wizard co.ador's Avatar
    Join Date
    Apr 2009
    Posts
    1,054
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    mail() function is not going through

    I got this warning after using the mail function. It seem not to be configure at the php.ini does anybody has any idea on how to fix it.

    Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\wamp\www\step2.php on line 14

  2. #2
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,580
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    You need a mail server to be able to send mail. If you're not going to run one on your own computer, then you need to put the details of the SMTP server you'll use in your php.ini.

  3. #3
    SitePoint Wizard co.ador's Avatar
    Join Date
    Apr 2009
    Posts
    1,054
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    do you have any site where I can get SMTP server?

  4. #4
    SitePoint Wizard PHPycho's Avatar
    Join Date
    Dec 2005
    Posts
    1,201
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by co.ador View Post
    do you have any site where I can get SMTP server?
    smtp.gmail.com (use authentication)
    Use Authentication: Yes
    Port for TLS/STARTTLS: 587
    Port for SSL: 465
    Copied from this link: http://mail.google.com/support/bin/a...n&answer=13287

  5. #5
    SitePoint Guru Ruben K.'s Avatar
    Join Date
    Jun 2005
    Location
    Alkmaar, The Netherlands
    Posts
    693
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Are you on shared hosting, dedicated server or do you have a localhost server?

  6. #6
    SitePoint Wizard co.ador's Avatar
    Join Date
    Apr 2009
    Posts
    1,054
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    @PHPycho

    It's that a free gmail service?

    Will have to get a gmail acouunt? I have one already.

    will the configuration below go inside the php.ini?

    smtp.gmail.com (use authentication)
    Use Authentication: Yes
    Port for TLS/STARTTLS: 587
    Port for SSL: 465

    php.ini

    [mail function]
    ; For Win32 only.
    SMTP = localhost
    smtp_port = 25
    smtp.gmail.com (use authentication)
    Use Authentication: Yes
    Port for TLS/STARTTLS: 587
    Port for SSL: 465
    Something like that?


    @Ruben K.

    I have a local server and a hosted server.

  7. #7
    SitePoint Wizard co.ador's Avatar
    Join Date
    Apr 2009
    Posts
    1,054
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I am getting the same error still, Can't get to configure the DNS server in my localhost.

    using this in the script to configure my php.ini
    PHP Code:
    <?php //set SMTP in php.ini
    ini_set("SMTP""smtp.gmail.com");?>
    The php.ini configuration is

    [mail function]
    ; For Win32 only.
    SMTP = localhost
    smtp_port = 25

    ; For Win32 only.
    sendmail_from = mail.stores.com

    but it is bringing a warning


    Warning: mail() [function.mail]: Failed to connect to mailserver at "smtp.gmail.com" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\wamp\www\step2.php on line 19

    Can ask my host provider for the DNS server, or am I missing something else in the code?

    I have used the toturial below and he talks about getting an DNS server, or ISP but I don't know where to find those tools to make it work. I have asked my domain host server and they give me mail.domainname.com as the DNS server but that's what I need for this purpose?

    http://www.youtube.com/watch?v=xHbiP...eature=related


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •