Jump to content
Larry Ullman's Book Forums

Recommended Posts

Hi everyone,

I'm typing this in the hope that it'll help other beginners who are working through Larry's book. Chapter 10 deals with using php to send emails. However, as Larry explains, you need a mail server to actually 'send' them and test them. I sort of bypassed that chapter because the idea of downloading a mail server and configuring it was just too daunting. But I now need to test something for a job so I've had to work at it.

 

I've found a really good video that explains it from start to finish. Here's the link:

.

 

All you experienced folks out there probably know all this stuff but I haven't a clue. I wasn't even sure what a mail server was until I reached chapter 10! So a couple of things that I fell over on.

First: the video talks about ip address 127.0.0.1. It appears that this is a universal ip address for localhost so that the mail server 'talks' to localhost.....or something like that.

Second: For some reason I cannot get it to send emails to external addresses, i.e. blahblah@wotsit.co.uk or clueless@gmail.com. There is stuff out there about this but it looks too scary to me as it talks about using your isp settings and the last thing I want to do is mess up my 'normal' email. So I set up two accounts with windows mail. This way I can use php to send emails from one to the other. My beginners logic says that if the php scripts work for sending an email from test1@localhost.com to test2@localhost.com then they'll work for anything else. Please would someone let me know if my logic is wrong.

Third: Once you set up the settings in Mercury mail, minimise the window. Don't close it. Even I know that a mail server can't send emails if it's off! It has to be 'running' in the XAMPP window.

 

I hope this helps others. It's really not difficult with the video to guide you.

 

Cheers

Paul

  • Upvote 1

Share this post


Link to post
Share on other sites

Thanks for sharing this Paul. I can now send the activation email in Ch 16 Example - User Registration using the mail function (on localhost). Previously, I was using my ISP's SMTP server to send emails but I recently switched to another ISP and couldn't use the new SMTP server becuase it requires authentication.

 

A section on how to configure the Mercury/32 mail server in future editions of the book would be great.

Share this post


Link to post
Share on other sites

Hi all,

Vince, or anyone else.

 

Has anyone managed to send or receive emails to or from external email address using the above setup. As I've said above I can send 'internally' from a localhost adress to a local host address but as soon as I try a message with an external address nothing is received. If I send from my gmail address it goes in the gmail sent box but nothing turns up on localhost. I've created a postmaster@localhost.com user and alias because I read that email accounts must have one of these addresses.

 

So far I've muddled through without needing this functionality but now I can't avoid it any more.

 

Cheers

Paul

Share this post


Link to post
Share on other sites

Hey Paul. I'd love to help here, but I don't use Windows much and I pretty much never worry about sending email from localhost, so I'm no good on this subject. Hopefully someone else will have some ideas. 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×