954,148 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Send email through php?

How do I send an email...

I have WAMP (windows xp apache, mysql and php).

But what do I do now. Explain...

iamthwee
Posting Expert
5,950 posts since Aug 2005
Reputation Points: 1,543
Solved Threads: 439
 

PHP has a function made for this exact purpose.

Mail($to, $subject, $body)

Do some research on it, it's not hard to use.

inzomniac
Newbie Poster
23 posts since Feb 2007
Reputation Points: 31
Solved Threads: 1
 

I'm afraid that didn't work, anyone else?

iamthwee
Posting Expert
5,950 posts since Aug 2005
Reputation Points: 1,543
Solved Threads: 439
 
I'm afraid that didn't work, anyone else?

If you didn't set up the smtp settings in your php.ini file, it won't work. Check the SMTP and smtp_port settings.

If you're determined not to use the mail function or need something more advanced, try phpMailer .

Good luck,
- Walkere

Walkere
Junior Poster in Training
57 posts since Jan 2008
Reputation Points: 29
Solved Threads: 5
 

Thank you for your reply, but what do I put for the smtp settings. Would it have something to do with my Internet service provider, would it be localhost? I'm confused :(

btw (I don't have an email client on windows)

iamthwee
Posting Expert
5,950 posts since Aug 2005
Reputation Points: 1,543
Solved Threads: 439
 
Thank you for your reply, but what do I put for the smtp settings. Would it have something to do with my Internet service provider, would it be localhost? I'm confused :(

I've never set one up on a windows server, but I would assume you would use your ISP's SMTP server. This is usually "smtp.isp.com" or "mail.isp.com" or some such thing. For example, mine is "mail.optonline.net" for Optimum Online.

This would be the same server you'd use to set up an e-mail client... if you used one =)

- Walkere

Walkere
Junior Poster in Training
57 posts since Jan 2008
Reputation Points: 29
Solved Threads: 5
 

Crap, is this a lot simpler to set up using linux then?

iamthwee
Posting Expert
5,950 posts since Aug 2005
Reputation Points: 1,543
Solved Threads: 439
 

No I'm not getting anywhere with this.

I think my mail SMTP is mail.btinternet.com

It returned successful when I did a telnet on port 25.

Start > run > (type in cmd)
telent mail.btinternet.com 25

I changed my php.ini file to match this, restarted the services yet I still get an authentication problem. I think it is because I don't have an email client....

iamthwee
Posting Expert
5,950 posts since Aug 2005
Reputation Points: 1,543
Solved Threads: 439
 

OK if I use a linux server, which is feasible, although my mom is gonna screw at me for wiping off windows LOL, does this avoid the problems regarding SMTP setting etc?

Thanx in advance.

iamthwee
Posting Expert
5,950 posts since Aug 2005
Reputation Points: 1,543
Solved Threads: 439
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You