i am getting error while sending mail using mail() function

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • vishal

    i am getting error while sending mail using mail() function

    i am getting following error.

    Warning: mail() [function.mail]: Failed to connect to mailserver at
    "smtp.gmail.com " port 465, verify your "SMTP" and "smtp_port" setting
    in php.ini or use ini_set() in D:\LUGUBA\root\ site\temp5.php on line 8

    i have done the following

    (1) in php.ini file

    SMTP = smtp.gmail.com
    smtp_port = 465
    sendmail_from = kathlal.panjabi @gmail.com

    (2)

    i am sendig mail using mail() function and i am passing only defaulst
    arguments to,subject,body

    is it enough to send a mail or something is missing??

    and do not i need to give password of my above email address
    kathlal.panjabi @gmail.com

    thxs for help in advance.......

  • Colin McKinnon

    #2
    Re: i am getting error while sending mail using mail() function

    vishal wrote:
    [color=blue]
    > i am getting following error.
    >
    > Warning: mail() [function.mail]: Failed to connect to mailserver at
    > "smtp.gmail.com " port 465, verify your "SMTP" and "smtp_port" setting
    > in php.ini or use ini_set() in D:\LUGUBA\root\ site\temp5.php on line 8
    >[/color]

    I think it's very nlikely that Gmail will allow relaying, although you
    should be able to send to your own account. Port 465 is for SMPTS (i.e. SSL
    wrapped SMTP)

    C.

    Comment

    • Alvaro G Vicario

      #3
      Re: i am getting error while sending mail using mail() function

      *** vishal wrote/escribió (6 Apr 2005 02:35:56 -0700):[color=blue]
      > SMTP = smtp.gmail.com
      > smtp_port = 465
      > sendmail_from = kathlal.panjabi @gmail.com[/color]

      Gmail's SMTP server only allows encrypted connections; it also requires a
      username and password. I don't think that mail() function can do such a
      job. You should find a different function to send mail. There're some
      clases in pear.php.net that may do the trick.




      --
      -- Álvaro G. Vicario - Burgos, Spain
      -- Don't e-mail me your questions, post them to the group
      --

      Comment

      • R. Rajesh Jeba Anbiah

        #4
        [Flag-FAQ] Re: i am getting error while sending mail using mail() function

        vishal wrote:[color=blue]
        > i am getting following error.
        >
        > Warning: mail() [function.mail]: Failed to connect to mailserver at
        > "smtp.gmail.com " port 465, verify your "SMTP" and "smtp_port" setting
        > in php.ini or use ini_set() in D:\LUGUBA\root\ site\temp5.php on line[/color]
        8
        <snip>

        Question flagged for FAQ. Should do it later.

        --
        <?php echo 'Just another PHP saint'; ?>
        Email: rrjanbiah-at-Y!com Blog: http://rajeshanbiah.blogspot.com/

        Comment

        Working...