jecs06 Posted March 12, 2007 Share Posted March 12, 2007 I'm running php on my local machine (windows xp) and have created the following simple snippet of code: <?php $to = "[email protected]"; $subject = "Test mail"; $message = "Hello! This is a simple email message."; $from = "[email protected]"; $headers = "From: $from"; mail($to,$subject,$message,$headers); echo "Mail Sent."; ?> However, when I load the page, no email is sent. Here is what is in my php.ini file . . . . . [mail function] ; For Win32 only. SMTP = smtp.googlemail.com smpt_port = 465 ; For Win32 only. sendmail_from = [email protected] The problem is I can't get it to work and have tried to understand what is going on but due to my lack of knowledge I can't really fix it. Could someone point me in the right direction please. Just to note, I am trying to use googlemail to send the email so was wondering if I needed passwords etc to send it? Could anyone help me please. Regards, JECS06 Link to comment https://forums.phpfreaks.com/topic/42414-help-me-work-this-out/ Share on other sites More sharing options...
trq Posted March 12, 2007 Share Posted March 12, 2007 You need to send the email from a valid address on the server. Link to comment https://forums.phpfreaks.com/topic/42414-help-me-work-this-out/#findComment-205755 Share on other sites More sharing options...
jecs06 Posted March 12, 2007 Author Share Posted March 12, 2007 I've set php.ini to the following: [mail function] ; For Win32 only. SMTP = smtp.googlemail.com smpt_port = 465 ; For Win32 only. sendmail_from = [email protected] Still doesn't work and the e-mail address is a valid one, any idea's? Link to comment https://forums.phpfreaks.com/topic/42414-help-me-work-this-out/#findComment-205760 Share on other sites More sharing options...
trq Posted March 12, 2007 Share Posted March 12, 2007 Check your trash/spam folder. Link to comment https://forums.phpfreaks.com/topic/42414-help-me-work-this-out/#findComment-205763 Share on other sites More sharing options...
jecs06 Posted March 12, 2007 Author Share Posted March 12, 2007 I've just logged on and there is nothing in my spam folder. Any idea's? As I say I followed some instructions and thought it would work with these settings and I'm just getting myself a little confused here. Link to comment https://forums.phpfreaks.com/topic/42414-help-me-work-this-out/#findComment-205765 Share on other sites More sharing options...
jscix Posted March 13, 2007 Share Posted March 13, 2007 smpt_port = 465 Should it be: smTP_port = 465 ? Link to comment https://forums.phpfreaks.com/topic/42414-help-me-work-this-out/#findComment-205973 Share on other sites More sharing options...
redarrow Posted March 13, 2007 Share Posted March 13, 2007 You can only send mail if the php.ini is set by you isp email account ok. if i was with lets say ball dog it would be somethink like this: [mail function] ; For Win32 only. SMTP = smtp.bulldog.com smpt_port = 25 ; For Win32 only. sendmail_from = [email protected] Link to comment https://forums.phpfreaks.com/topic/42414-help-me-work-this-out/#findComment-205977 Share on other sites More sharing options...
sn33kyp3t3 Posted March 13, 2007 Share Posted March 13, 2007 Gmail smtp requires TLS authentication. The only way I know how to send authenticated mail is using the sockets. ex: fsockopen("tls://....) There might be a way to configure php.ini, but I suggest you consult php documentation on that. It may require other protocols. Link to comment https://forums.phpfreaks.com/topic/42414-help-me-work-this-out/#findComment-205996 Share on other sites More sharing options...
presso Posted March 13, 2007 Share Posted March 13, 2007 php is not just going to send the email by itself it still needs to be routed through a smtp server on your windows box to do this , something like this would do the trick http://www.softstack.com/advsmtp.html although there are heaps out there to choose from. Link to comment https://forums.phpfreaks.com/topic/42414-help-me-work-this-out/#findComment-206001 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.