Jump to content



Photo
* * * * - 1 votes

Windows and PHP Email Catcher (for Developers)


  • Please log in to reply
3 replies to this topic

#1   Harald Ponce de Leon

Harald Ponce de Leon

    Healthy Giraffe

  • Core Team
  • 5,346 posts
  • Real Name:Harald Ponce de Leon
  • Gender:Male
  • Location:Solingen, Germany

Posted 05 November 2014 - 17:47

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.


:heart: , osCommerce


#2   PupStar

PupStar
  • Members
  • 902 posts
  • Real Name:Mark
  • Gender:Male

Posted 05 November 2014 - 19:01

brilliant, thanks Harald :beers:

 

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


Bootstrap 3 ROCKS!

(or it will if I ever get my head around it lol)

(and I think I have now (w00t) )


#3   benturner

benturner
  • Members
  • 1 posts
  • Real Name:Ben Turner

Posted 06 November 2014 - 15:30

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.



#4   tini1123

tini1123
  • Members
  • 2 posts
  • Real Name:Rakesh Singh

Posted 09 February 2015 - 11:32

<?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.