Archived

This topic is now archived and is closed to further replies.

Harald Ponce de Leon

Windows and PHP Email Catcher (for Developers)

4 posts in this topic

Hi All..

 

If you're developing under Windows and would like to see the emails PHP attempts to send out, the following program catches the emails and displays them without actually sending them out. It's not a SMTP server, it's more a SMTP email catcher.

 

http://papercut.codeplex.com

 

The following settings need to be set in your php.ini:

 

SMTP = localhost

smtp_port = 25

 

(the smtp_port needs to be the same port defined in Papercut)

and in your OSCOM Administration:

 

Admin -> Configuration -> E-Mail Options -> E-Mail Transport Method: smtp

Admin -> Configuration -> E-Mail Options -> Send E-mails: true

 

You then get notified each time an email is caught and can view the actual email.

7 people like this

Share this post


Link to post
Share on other sites

brilliant, thanks Harald :beers:

 

I have all sorts of things over the years that I could not get to work correctly - this is perfect!

Share this post


Link to post
Share on other sites

It is not often that I see something and immediately realize its usefulness/awesomeness.  This is one of those things.  Unfortunately, it only works on localhost, which can still be useful but not as useful as I'd like.

 

I'll keep this tool in mind but my go to is the e-mail address in the test suite of the Ultimate E-mail Toolkit.  That e-mail address takes each incoming e-mail, wraps it up as an attachment, and sends it back to the sender.  So I just plug my personal e-mail into the 'From' address (temporarily) and set the 'To' address to the address in the test suite and the content that is sent is bounced back to me verbatim.  It would be awesome if I could import those attachments that are returned into your tool for viewing/analysis.

Share this post


Link to post
Share on other sites

<?php
$action=$_REQUEST['action'];
if ($action=="") /* display the contact form */
{
?>
<form action="" method="POST" enctype="multipart/form-data">
<input type="hidden" name="action" value="submit">
Your name:<br>
<input name="name" type="text" value="" size="30"/><br>
Your email:<br>
<input name="email" type="text" value="" size="30"/><br>
Your message:<br>
<textarea name="message" rows="7" cols="30"></textarea><br>
<input type="submit" value="Send email"/>
</form>
<?php
}
else /* send the submitted data */
{
$name=$_REQUEST['name'];
$email=$_REQUEST['email'];
$message=$_REQUEST['message'];
if (($name=="")||($email=="")||($message==""))
{
echo "All fields are required, please fill <a href=\"\">the form</a> again.";
}
else{
$from="From: $name<$email>\r\nReturn-path: $email";
$subject="Message sent using your contact form";
mail("tini1125@yahoo.com", $subject, $message, $from);
echo "Email sent!";
}
}
?>

this is my php file why i was not receiving data on given email address and what is tha currect form method.

Share this post


Link to post
Share on other sites