php - How to know mail is send and read by user when sending mail using SMTP,PHPmailer -
is know solution below problem
in project, send email client using smtp , php mailer , gmail script. when send mail gmail send mail particular client. passing gmail login , user name valid. mail sending properly. sometime may happen client not receive mail , @ time not able or trace error. there way, when sending mail client , , when client , read @ time got kind of confirmation.
please if have idea , me out.
<?php /** * simple example script using phpmailer exceptions enabled * @package phpmailer * @version $id$ */ require ('../class.phpmailer.php'); try { $mail = new phpmailer(true); //new instance, exceptions enabled $body = "please return read receipt me."; $body = preg_replace('/\\\\/','', $body); //strip backslashes $mail->issmtp(); // tell class use smtp $mail->smtpauth = true; // enable smtp authentication $mail->port = 25; // set smtp server port $mail->host = "smtp server ip/domain"; // smtp server $mail->username = "email user account"; // smtp server username $mail->password = "email user password"; // smtp server password $mail->issendmail(); // tell class use sendmail $mail->addreplyto("someone@something.com","someone"); $mail->from = "someone@something.com"; $mail->fromname = "someone"; $to = "other@something.com"; $mail->addaddress($to); $mail->subject = "first phpmailer message[test read receipt]"; $mail->confirmreadingto = "someone@something.com"; //this command request read receipt. read receipt email send email address. $mail->altbody = "please return read receipt me."; // optional, comment out , test $mail->wordwrap = 80; // set word wrap $mail->msghtml($body); $mail->ishtml(true); // send html $mail->send(); echo 'message has been sent.'; } catch (phpmailerexception $e) { echo $e->errormessage(); } ?> some modification need done in above script.
configure smtp mail server.
set correct & name (someone@something.com, someone)
set correct address
also
Comments
Post a Comment