PHP email form testing
Moderator: General Moderators
PHP email form testing
Is it possible to set up some kind of local smtp test server?
I have IIS 5.1 and PHP 4.3.4 setup and running fine. I also have made some test scripts of email submission forms with the PHP scripts running locally on my IIS server they work fine but when i test them out there is no email submitted to my yahoo account.
I have IIS 5.1 and PHP 4.3.4 setup and running fine. I also have made some test scripts of email submission forms with the PHP scripts running locally on my IIS server they work fine but when i test them out there is no email submitted to my yahoo account.
For local testing there's a nice package called XAMPP (http://www.apachefriends.org) which has everything you need. It includes something called Mercury Mail Transport System that you could try.
Alternatively, you could use phpMailer (http://phpmailer.sourceforge.net) and then specify an external SMTP server such as your ISP's.
Alternatively, you could use phpMailer (http://phpmailer.sourceforge.net) and then specify an external SMTP server such as your ISP's.
Mercury Mail Transport System is available seperately:
http://www.pmail.com/overviews/ovw_mercury.htm
I've never used it myself, but know other people have used it and say it's quite simple to set up.
The benefit of using an external SMTP server would be that you WOULDN'T have to set up anything. You'd just be using the same SMTP server you use to send your regular email.
If your ISP provides you with access to their SMTP server you could try that.
http://www.pmail.com/overviews/ovw_mercury.htm
I've never used it myself, but know other people have used it and say it's quite simple to set up.
The benefit of using an external SMTP server would be that you WOULDN'T have to set up anything. You'd just be using the same SMTP server you use to send your regular email.
If your ISP provides you with access to their SMTP server you could try that.
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Well I used MailTraq on Win32...
http://www.mailtraq.com/246/
It'll do IMAP and SMTP and NNTP and POP3
MDaemon is also just about the standard.
EDIT | The email njot reaching Yahoo will be a Junk mail filter issue
http://www.mailtraq.com/246/
It'll do IMAP and SMTP and NNTP and POP3
MDaemon is also just about the standard.
EDIT | The email njot reaching Yahoo will be a Junk mail filter issue
Last edited by Chris Corbyn on Tue Jul 19, 2005 9:56 am, edited 1 time in total.
Using phpMailer you'd just do something like the following:
I'm not sure how much simpler you can you get?!?!!
Code: Select all
require("class.phpmailer.php");
$mail = new PHPMailer();
$mail->IsSMTP(); // set mailer to use SMTP
$mail->Host = "smtp.example.com"; // specify server
$mail->SMTPAuth = true; // turn on SMTP authentication
$mail->Username = "username"; // SMTP username
$mail->Password = "secret"; // SMTP password
$mail->From = "from@example.com";
$mail->AddAddress("to@example.com");
$mail->Subject = "Here is the subject";
$mail->Body = "This is the message body";
$mail->Send();- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
- Ambush Commander
- DevNet Master
- Posts: 3698
- Joined: Mon Oct 25, 2004 9:29 pm
- Location: New Jersey, US
Its true he does need to keep it on localhost server well spotted d11.
If my ISP, which i think it does, allows me to make outgoing SMTP connections how would i set it up? Is is just a case of changing my preferences in IIS or do I have to reconfigure(?) the php.ini file?
I just re read my original post and i think i was a little unclear about what i need to do. So...
Just to clarify, as i am a begninner, I have setup IIS and PHP. Ran the PHPtest script to check it was working, fine. I then made an email submission form with PHP and HTML, setting the mail address to my yahoo account so i could create a form in my website and test it out before uploading it all. When i sent the email the script ran without errors but i did not recieve the email. So... I think i have this right. Using PHPMailer, MDaemon or Mailtraq i can achieve this with a basic knowledge of PHP, IIS and SMTP.
If my ISP, which i think it does, allows me to make outgoing SMTP connections how would i set it up? Is is just a case of changing my preferences in IIS or do I have to reconfigure(?) the php.ini file?
I just re read my original post and i think i was a little unclear about what i need to do. So...
Just to clarify, as i am a begninner, I have setup IIS and PHP. Ran the PHPtest script to check it was working, fine. I then made an email submission form with PHP and HTML, setting the mail address to my yahoo account so i could create a form in my website and test it out before uploading it all. When i sent the email the script ran without errors but i did not recieve the email. So... I think i have this right. Using PHPMailer, MDaemon or Mailtraq i can achieve this with a basic knowledge of PHP, IIS and SMTP.