January 14th, 2008
Tips and Tools
Sending email through your local host through WAMP or XAMPP
Sourced from: Roshan’s Blog
It’s not hard to start pulling out your hair trying to send email through your localhost using wamp or xampp… Here’s how.
1) Open the “php.ini“. You should know where it is located because it depends upon the particular server you’re running.
2) Search for the attribute called “SMTP” in the php.ini file.Generally you can find the line “SMTP=localhost“. change the localhost to the smtp server name of your ISP. And, there is another attribute called “smtp_port” which should be set to 25.I’ve set the following values in my php.ini file.
SMTP = smtp.wlink.com.np smtp_port = 25
3) Restart the apache server so that PHP modules and attributes will be reloaded.
4) Now try to send the mail using the mail() function ,
mail(”you@yourdomain.com”,”test subject”,”test body”);
you might get the warning like this,
Your ads will be inserted here by
Please go to the plugin admin page to paste your ad code.
Warning: mail() [function.mail]: “sendmail_from” not set in php.ini or custom “From:” header missing in C:\Program Files\xampp\htdocs\testmail.php on line 1
5) Now specify the following headers and try to send the mail again,
$headers = ‘MIME-Version: 1.0′ . “\r\n”; $headers .= ‘Content-type: text/html; charset=iso-8859-1′ . “\r\n”; $headers .= ‘From: sender@sender.com’ . “\r\n”; mail(”you@yourdomain.com”,”test subject”,”test body”,$headers);
Well that’s all, the mail is sent to “you@yourdomain.com” from the localhost.
Note : Some smtp server verifies the email address of the sender so the email address which is in the place of “sender@sender.com” should be a valid and existing email address otherwise mail might not be sent to the “you@yourdomain.com”.
Tags: wamp, xampp, localhost, openjason, technology, email
Tags: xampp, wamp, email, localhost, php, openjason
Popularity: 2% [?]

Comments
[...] Sending email through your local host through WAMP or XAMPP Generally you can find the line “SMTP=localhost“. change the localhost to the smtp server name of your ISP. And, there is another attribute called “smtp_port” which should be set to 25.I’ve set the following values in my php.ini file. … [...]
Sending email through your local host through WAMP or XAMPP
January 19th, 2008
ive set the smtp server name of my isp but i still got this error message
Warning: mail() [function.mail]: Failed to connect to mailserver at “home.philcome.ph” port 25, verify your “SMTP” and “smtp_port” setting in php.ini or use ini_set() in C:\wamp\www\components\com_preventive\views\preventive\tmpl\default.php on line 754
Warning: mail() [function.mail]: Failed to connect to mailserver at “home.philcome.ph” port 25, verify your “SMTP” and “smtp_port” setting in php.ini or use ini_set() in C:\wamp\www\components\com_preventive\views\preventive\tmpl\default.php on line 756
Fatal error: Maximum execution time of 30 seconds exceeded in C:\wamp\www\components\com_preventive\views\preventive\tmpl\default.php on line 756
neil
February 10th, 2009
is stmp username and password important?
where can i find the mail() function (statement no.4)?
where can i find the header to be specified (statement no.5)?
sorry because im just a newbie
please help
im using wamp server
neil
February 10th, 2009
please i am new to php.so send me a mail how to send a mail from xampp from localhost.in detail step
ranjith
January 14th, 2010
hi sir.. i have a problem in email sending..please plz help me..i make all logic for email sending but i dnt still change in the php.ini file…bcoz from where i have to get SMTPserver name of isp…do i have to call and ask…there is no other alternative…can i dnt look into my network connection.. ..and still i dnt setting the outlook..is it necessary to set the outlook…..plzz plzz give me some guidness…
umarbutt
November 25th, 2010
Warning: mail() [function.mail]: SMTP server response: 550-Verification failed for 550-Unrouteable address 550 Sender verify failed in C:\wamp\www\website\registration_db.php on line 30
and sir i have this kind of error…and i have installed wamp5…plz do something…
umarbutt
November 25th, 2010
Hi, I’ve changed my php.ini smtp settings to my smtp_port settings of ISP still I’m unable to send mail. There is no blocking from my ISP.
sijran
January 10th, 2011