470,815 Members | 1,310 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,815 developers. It's quick & easy.

PHP -Mail problem

Hi ,

I am using WAMP for my php application.My problem is that I can't send mail using php mail() function . I am not configured SMTP.How can I configure SMTP? which SMTP server can I use for this?

Thanks & Regards,

Roshin
Jul 29 '08 #1
7 7334
It should work. You could try to connect to a SMTP server using telnet on port 25 and see at least if you can connect. It may be that your ISP is blocking outgoing connections on port 25 to prevent spamming, you should also contact them to find out. If port 25 is open, please get back to us with an example of how you've called the mail() function.

Regards,
Tom
Jul 29 '08 #2
It should work. You could try to connect to a SMTP server using telnet on port 25 and see at least if you can connect. It may be that your ISP is blocking outgoing connections on port 25 to prevent spamming, you should also contact them to find out. If port 25 is open, please get back to us with an example of how you've called the mail() function.

Regards,
Tom
How can i configure SMTP using GMail? I am using WAMP in my local machine?
Jul 29 '08 #3
henryrhenryr
103 100+
try phpmailer:

http://sourceforge.net/projects/phpmailer

When you download it, look in the examples and there is one for gmail. It doesn't require any changes to your php setup, just setup the script correctly as in the example...
Jul 29 '08 #4
I have just installed the WAMP in my local machine.Can you give the details of configuring smtp using Gmail in php.ini. should I install phpmailer class?Is there any other way to send mail using smtp?
Jul 30 '08 #5
henryrhenryr
103 100+
I have just installed the WAMP in my local machine.Can you give the details of configuring smtp using Gmail in php.ini. should I install phpmailer class?Is there any other way to send mail using smtp?
I found that phpmailer was the easiest solution. I attempted to setup the SMTP in php and found it wouldn't quite work but I got phpmailer working in about 5 minutes.

Another method I did try in Windows was to use blat with stunnel and then use exec() to send the blat command to your computer. You can google blat and stunnel - both free software.

Unless you have a specific reason not to try phpmailer, I really would give it a go - it is just easier...
Jul 30 '08 #6
I used the phpmailer

But got this error
Warning: fsockopen() [function.fsockopen]: unable to connect to ssl://smtp.gmail.com:465 (Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?) in E:\wamp\www\phpmailer\class.smtp.php on line 122
Mailer Error: Language string failed to load: connect_host
Jul 30 '08 #7
henryrhenryr
103 100+
Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?
Hi Roshin

Sorry it wasn't as easy as I suggested! You can fix it, as the error says, by enabling ssl. I didn't realise WAMP doesn't enable by default...

Quick Instructions:
open php.ini
uncomment line ";extension=php_openssl.dll"
restart WAMP

Verbose...
- you should find a link to php.ini if you left click on the WAMP icon in the taskbar
- look for "config files" click on php.ini.
- ctrl+f and find "openssl"
- hopefully the following line is there: ";extension=php_openssl.dll"
- remove the ";"
- save php.ini
- left click on WAMP icon in taskbar again
- select restart all services
- test you phpmailer again

Tested OK on WAMP5 1.7.2

Hope this works for you!
Jul 31 '08 #8

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

5 posts views Thread by Bruce W...1 | last post: by
6 posts views Thread by Mike the Canadian | last post: by
4 posts views Thread by Shawn Zheng | last post: by
6 posts views Thread by chris | last post: by
2 posts views Thread by Mitul | last post: by
rsrinivasan
3 posts views Thread by rsrinivasan | last post: by
reply views Thread by Emmanuel Petit | last post: by
1 post views Thread by the_ricka | last post: by
1 post views Thread by =?Utf-8?B?VGltb3RoeQ==?= | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.