By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,473 Members | 1,274 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,473 IT Pros & Developers. It's quick & easy.

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

P: n/a
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 = ka*************@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
ka*************@gmail.com

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

Jul 17 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
vishal wrote:
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 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.

Jul 17 '05 #2

P: n/a
*** vishal wrote/escribió (6 Apr 2005 02:35:56 -0700):
SMTP = smtp.gmail.com
smtp_port = 465
sendmail_from = ka*************@gmail.com


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
--
Jul 17 '05 #3

P: n/a
vishal wrote:
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
<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/

Jul 17 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.