dream25 Posted January 22, 2007 Share Posted January 22, 2007 Hi... if anyone going to send an email...to my id... if i recieve that mail i wanna to send a autoreply mail... actually i have the code for sending mail... below..<?phprequire("class.phpmailer.php");$mail = new PHPMailer();$mail->IsSMTP(); // telling the class to use SMTP$mail->Host = "localhost"; // SMTP server$mail->From = "[email protected]";$mail->AddAddress("[email protected]");$mail->Subject = "first mailing";$mail->Body = "hi ! \n\n this is First mailing I made myself with PHPMailer !";$mail->WordWrap = 50;if(!$mail->Send()){ echo "Message was not sent"; echo "Mailer Error: " . $mail->ErrorInfo;}else{ echo "Message has been sent";}?> Link to comment https://forums.phpfreaks.com/topic/35191-code-for-autoreply/ Share on other sites More sharing options...
trq Posted January 22, 2007 Share Posted January 22, 2007 And.... your question is? Link to comment https://forums.phpfreaks.com/topic/35191-code-for-autoreply/#findComment-166189 Share on other sites More sharing options...
Lyleyboy Posted January 22, 2007 Share Posted January 22, 2007 THIS SCRIPT REPLIES ON BEING FED BY A FORM WITH ONE CRITICAL FIELD WHICH IS EMAIL. THIS IS HOW THE FORM KNOWS WHERE TO SEND THE AUTORESPONDER TO.THE FORM SHOULD LOOK SOMETHING LIKE THIS<form action="script.php" method="post"><input type="text" name="email"><input type="submit"></form>[code]//Autoresponder$mailto="$email";$subject="SUBJECT LINE";$body.="Thank you for contacting us.\n";$body.="We will get back to you shortly.\n";mail($mailto,$subject,$body,"From: WHO THE MESSAGE IS FROM\n");//Mail to admin$mailto="[email protected]";$subject="SUBJECT LINE";$body1.="You have been sent the following message.\n";$body1.="Name: $your_name\n";mail($mailto,$subject,$body1,"From: WHO THE MESSAGE IS FROM\n");[/code] Link to comment https://forums.phpfreaks.com/topic/35191-code-for-autoreply/#findComment-166193 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.