Jump to content

PHP + Sending emails...Very new and wondering how its done.


eva21

Recommended Posts

This is what i get:

 

Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\wamp\www\emailTest.php on line 7

Mail Sent.

 

But it didnt send because i sent it to my gmail and nothing happened.

This is what i get:

 

Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\wamp\www\emailTest.php on line 7

Mail Sent.

 

But it didnt send because i sent it to my gmail and nothing happened.

 

For a local wamp server chances are the mail function will not work. Due to the simple fact that you have to have a mail server installed on your box for it to work. Not to mention that most ISP's block Port 25, which is what most mail is sent on.

 

Do a google for a script called "phpGMailer" this script will allow you to input your gmail account information and send email using that as the median. See the script description etc for usage.

That is to send with GMAIL accounts only, im looking for any time of email addresses.

 

For localhost, unless you plan on setting up a full on webserver locally, that should suffice for development. Most servers provide you access to their mail server so this would not arise on an actual server.

 

I would suggest, for ease of use on a local "Development" box, if that is what it is, to use that script with a gmail account (as you can send up to 100 emails a day) and test your settings. If you do not, you can attempt to see if your ISP offers you access to an SMTP server and get that information then add it to the php.ini. If they do that would be the best route to go, or find your own free smtp service.

 

Windows boxes do not come with a mail server installed, and on linux you have to install one yourself. But access to port 25 is required for most web servers. As stated before, ISP's tend to block this port due to spam.

 

And as for that only sending to your "gmail" account, that would use your gmail account as the SMTP server. (as mike pointed out above).

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.