pnutUUM Posted March 2, 2006 Share Posted March 2, 2006 i've tried the code as below, but there's an error,saying [b]"Warning: 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:\program files\easyphp1-7\www\project\frgtpswd.php on line 27[/b].i have no idea to set the php.ini...please help me..$email = "whoever@yourmailing.com"; $subject = "Subject!"; $body = "whatever you want to email"; $from = "From: Emailers Name <email@address.com>";mail($email,$subject,$body,$from); Quote Link to comment Share on other sites More sharing options...
grim1208 Posted March 2, 2006 Share Posted March 2, 2006 Have you tested this online through your ftp or is this a local host error? What are you using for local host? Apache or IIESI ask this because I setup dozens of mail() source code, and I can't get it to work locally, it might be something with php.ini but I think it's just wether or not th feature comes with the localhost. (probably wrong :P) But when I test this online (just have the email go to me during testing) it works perfect on all the servers I have ever put it on.Let me know, also I have a little better script I could give you for the email.Let me know Quote Link to comment Share on other sites More sharing options...
pnutUUM Posted March 3, 2006 Author Share Posted March 3, 2006 [!--quoteo(post=351009:date=Mar 2 2006, 11:37 AM:name=grim1208)--][div class=\'quotetop\']QUOTE(grim1208 @ Mar 2 2006, 11:37 AM) [snapback]351009[/snapback][/div][div class=\'quotemain\'][!--quotec--]Have you tested this online through your ftp or is this a local host error? What are you using for local host? Apache or IIESI ask this because I setup dozens of mail() source code, and I can't get it to work locally, it might be something with php.ini but I think it's just wether or not th feature comes with the localhost. (probably wrong :P) But when I test this online (just have the email go to me during testing) it works perfect on all the servers I have ever put it on.Let me know, also I have a little better script I could give you for the email.Let me know[/quote]thanks for your attention...i'm so glad that someone has replied me...hehehe...i used the coding in the localhost..using apache...so,i think that was the problem...so, i'll try using it online and i'll tell u later if it works...regards,shafinah Quote Link to comment Share on other sites More sharing options...
pnutUUM Posted March 3, 2006 Author Share Posted March 3, 2006 [!--quoteo(post=351009:date=Mar 2 2006, 11:37 AM:name=grim1208)--][div class=\'quotetop\']QUOTE(grim1208 @ Mar 2 2006, 11:37 AM) [snapback]351009[/snapback][/div][div class=\'quotemain\'][!--quotec--]Have you tested this online through your ftp or is this a local host error? What are you using for local host? Apache or IIESI ask this because I setup dozens of mail() source code, and I can't get it to work locally, it might be something with php.ini but I think it's just wether or not th feature comes with the localhost. (probably wrong :P) But when I test this online (just have the email go to me during testing) it works perfect on all the servers I have ever put it on.Let me know, also I have a little better script I could give you for the email.Let me know[/quote]sadly telling you that the coding does nt work even when i used online...i don't know what to do...can u help me? Quote Link to comment Share on other sites More sharing options...
ToonMariner Posted March 3, 2006 Share Posted March 3, 2006 The error on your local machine is down to a configuration setting...Open your php.ini file and find the setting 'SMTP =' (its probably set equal to localhost.Now you need to change this setting to teh smtp of your own internet provided. I am with telewest so mine isSMTP = smtp.blueyonder.co.ukyour will be different I imagine.If you have outlook or outlookexpress as your email app on you pc you can find the smtp you us in there....TOOLS > e-mail accounts > view or change... > change. You shoidl then see a form and on the right hand side you will see 'Outgoing mail server' it is the text in that box you need to copy adn paste into your php.ini file.Oh and when you try it on-line again tell us what erros you are getting..... Quote Link to comment Share on other sites More sharing options...
grim1208 Posted March 4, 2006 Share Posted March 4, 2006 [!--quoteo(post=351309:date=Mar 3 2006, 09:30 AM:name=ToonMariner)--][div class=\'quotetop\']QUOTE(ToonMariner @ Mar 3 2006, 09:30 AM) [snapback]351309[/snapback][/div][div class=\'quotemain\'][!--quotec--]The error on your local machine is down to a configuration setting...Open your php.ini file and find the setting 'SMTP =' (its probably set equal to localhost.Now you need to change this setting to teh smtp of your own internet provided. I am with telewest so mine isSMTP = smtp.blueyonder.co.ukyour will be different I imagine.If you have outlook or outlookexpress as your email app on you pc you can find the smtp you us in there....TOOLS > e-mail accounts > view or change... > change. You shoidl then see a form and on the right hand side you will see 'Outgoing mail server' it is the text in that box you need to copy adn paste into your php.ini file.Oh and when you try it on-line again tell us what erros you are getting.....[/quote]Now I know I can fix the localhost problem, thanks.And yes please tell us the online error message. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.