473,378 Members | 1,138 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

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 = 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
3 3282
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
*** 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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: joe215 | last post by:
I want my users to send emails from a Windows app that I am developing in Visual Basic.NET 2003. I found a good example of sending email to a SMTP server using the SmtpMail class. However, using...
9
by: B-Dog | last post by:
I've built a small app that sends mail through our ISP's SMTP server but when I try to send through my local exchange server I get CDO error. Does webmail use SMTP or does it strictly rely on...
3
by: dgiagio | last post by:
Hi, I'm creating a SMTP application and I would like to hear opinions about error handling. Currently there are two functions that communicate with the remote peer: ssize_t...
1
by: Sachin1234 | last post by:
Hi , I am getting the error in system log that " The remote server did not respond to a connection attempt." i am using following code for sending mail /**************** Work for...
2
abdoelmasry
by: abdoelmasry | last post by:
Hi Guys Could Any One Help me to use mail() function ?? I can use mail() to send messages to any mail server but i have problem while sending to HOTMAIL Im Using this code : <?php...
2
by: =?Utf-8?B?QWRl?= | last post by:
HI All, I am encountering the following error when I try to send an email through a SMTP server. I believe the problem lies with the authentication part when the network crednetials are used,...
10
by: crazycooter | last post by:
I found an old thread on this (http://groups.google.com/group/alt.php/ browse_thread/thread/751edb9c723316c4/ea9bf92a9c6b807c?lnk=gst&q=mail() +duplicate&rnum=7#ea9bf92a9c6b807c), but there didnt...
1
by: akuva | last post by:
I have to send more than 100s of email using a php code if i use mail function whether it will be sent to spam or inbox. If it is sent to spam which is the other way to send mass email from php. i...
2
by: satnamsarai | last post by:
Using System.Net.Mail: Sometimes I get error 'failure sending mail. Unable to write data to the transport connection: An existing connection was forcibly closed by the remote host.' Not sure how...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.