Posted by Prakash Timilsina Sunday, February 14, 2010

Share
I was so worried that i was not able to send the E-mail from the localhost while using WAMP and i asked to my teacher that how can i send the E-mail from the localhost ? and he instructed me to follow the given instruction. This instruction is for both WAMP and XAMPP users.

1. Now open php.ini  file.
2. search for the STMP attribute. 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.

3. change the attribute as :


STMP = stmp.wlink.com.np
stmp_port = 25

I made stmp.wlink.com.np as my internet service provider (ISP) is Wlink.com.np

4.Now restart your apache server. so that your php.ini file will be reloaded.


5. now try sending the mail using main() function :)
thats it !!


You might get teh error message like this :


Warning: mail() [function.mail]: “sendmail_from” not set in php.ini or custom “From:” header missing in D:\wamp\www\Website\mail.php on line 28


if you get the error like this the specify the following headers and try 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”,”subject”,”body”,$headers);

Now it will work :)

2 comments

    v
  1. Adams Kevin Says:
  2. I ADAMS KEVIN, a representative Aiico Insurance plc, we trust and respect for individual differences in day out a loan. We will provide 2% of the loan's interest rate. If you are interested in this business contact us by e-mail: (adams.credi@gmail.com) now transfer their loan documents issued properly. Do you need a loan to set up business or school if you are very welcome to Aiico Insurance plc. You can also contact us by e-mail: (adams.credi@gmail.com). We first week can request a balance transfer.

    DO YOU NEED LOAN FOR PERSONAL BUSINESS? IF YOU CONTACT YOUR EMAIL ABOVE TO PROCEED WITH YOUR LOAN TRANSFER IMMEDIATELY OK.

      Posted on February 21, 2015 at 3:20 AM
  3. Blogger Says:
  4. DreamHost is one of the best hosting company with plans for all of your hosting requirements.

      Posted on November 15, 2017 at 7:01 AM
:)) ;)) ;;) :D ;) :p :(( :) :( :X =(( :-o :-/ :-* :| 8-} :)] ~x( :-t b-( :-L x( =))

Post a Comment

Goto Top