phpRob 10 Posted November 7, 2011 Report Share Posted November 7, 2011 I'm curently going through Chapter 8 and learning about the mail() function. As i expected the script produces a warning message when I try to send mail locally to gmail, hotmail or any mail server. As Larry mentions in the book this isn't a problem as you'll never host the website locally, I'm just interested to hear if anyone managed to get this to work? Spent a bit of time fiddlng last night, not going to waste too much time on it though, far too much learning to be done!! Quote Link to post Share on other sites
Larry 433 Posted November 7, 2011 Report Share Posted November 7, 2011 Other people certainly have. You'll find answers in the old forum (www.larryullman.com/forum/), I believe. Personally, I don't bother, but I understand the desire to. Quote Link to post Share on other sites
Jonathon 255 Posted November 7, 2011 Report Share Posted November 7, 2011 What system are you using Rob, XAMPP? Quote Link to post Share on other sites
phpRob 10 Posted November 7, 2011 Author Report Share Posted November 7, 2011 What system are you using Rob, XAMPP? Yes XAMPP. Quote Link to post Share on other sites
Jonathon 255 Posted November 7, 2011 Report Share Posted November 7, 2011 It's easier than you think try this link it's essentially just finding out what your ISP smtp address is and altering your php.ini file. http://roshanbh.com.np/2007/12/sending-e-mail-from-localhost-in-php-in-windows-environment.html Quote Link to post Share on other sites
phpRob 10 Posted November 8, 2011 Author Report Share Posted November 8, 2011 @Jonathon - Thanks a bunch, that hopefully will be useful and I'll be able to send mail locally. Is this the method you used to send email locally in a Wndows environment? After setting this up would I have to send mail to my ISP email address e.g. to my plusnet email address or would it work fr gmail/hotmail etc? Also did you have to specify the headers when coding the mail function as suggested later on in the tutorial? Quote Link to post Share on other sites
Jonathon 255 Posted November 8, 2011 Report Share Posted November 8, 2011 Yep, I don't really know the ins and outs of it. You need to find out the address for your smtp server for your ISP. It's not your email address, but you can set the mail header as if it came from your email address. I personally didn't have to do anything else but the first step: SMTP = smtp.isp.co.uk (or whatever yours is) smtp_port = 25 I also changed the setting in my .ini file to set the mail sending address. sendmail_from = your email address goes here. 1 Quote Link to post Share on other sites
phpRob 10 Posted November 8, 2011 Author Report Share Posted November 8, 2011 I also changed the setting in my .ini file to set the mail sending address. sendmail_from = your email address goes here. The email address of the ISP I have (my ISP is plusnet so rob@plusnet.com) or any email address I own (@gmail.com etc.)? Quote Link to post Share on other sites
Jonathon 255 Posted November 8, 2011 Report Share Posted November 8, 2011 I think you can actually put either, the email address I set it to wasn't related to my ISP 1 Quote Link to post Share on other sites
phpRob 10 Posted November 8, 2011 Author Report Share Posted November 8, 2011 That worked a treat, thank you so much Didn't think it would be so simple to set up, I could have wasted so many hours trying to get that to work. Quote Link to post Share on other sites
Jonathon 255 Posted November 8, 2011 Report Share Posted November 8, 2011 Yeah I did prior to reading that. Quote Link to post Share on other sites
phpRob 10 Posted November 9, 2011 Author Report Share Posted November 9, 2011 My mercury mal server wasn't enabled when I sent the mail locally? Is this normal? I thought sending mail wasn't possible without a mail server, or is the mail server my ISP? Quote Link to post Share on other sites
Jonathon 255 Posted November 9, 2011 Report Share Posted November 9, 2011 I don't really know to be honest, I would imagine that its the ISP. All I knew was that it works and I was happy with that as I wanted to test some HTML emails and activation codes etc. Sorry I can't be more helpful Quote Link to post Share on other sites
Larry 433 Posted November 9, 2011 Report Share Posted November 9, 2011 Yes, your ISP is acting as the mail server in that case. Quote Link to post Share on other sites
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.
Note: Your post will require moderator approval before it will be visible.