unable to send email through PHP with POP3 -
i have completed writing php code in order send email pop3. every time being faced error
[error] => connecting pop3 server raised php warning: [errno] => 2 [errstr] => fsockopen() [function.fsockopen]: unable connect pop3.yahoo.com:465 (a connection attempt failed ) smtp -> error: failed connect server: connection attempt failed because connected party did not respond after period of time,
here code.
<?php require_once('/class.phpmailer.php'); require_once('/class.pop3.php'); // required pop before smtp $pop = new pop3(); $pop->authorise('pop3.yahoo.com',465,10, 'arsalansherwani@yahoo.com', '******',1); $mail = new phpmailer(); $msg='name'; //$body = file_get_contents('contents.html'); //$body = eregi_replace("[\]",'',$body); $address='arsalanjawed619.com'; $mail->issmtp(); $mail->smtpdebug = 1; $mail->host = 'pop3.yahoo.com'; $mail->setfrom('arsalansherwani@yahoo.com', 'arsalan'); $mail->addreplyto("arsalansherwani@yahoo.com","arsalan"); $mail->subject = "phpmailer test subject via pop before smtp, basic"; $mail->altbody = "to view message, please use html compatible email viewer!"; $mail->msghtml($msg); $address = "arsalanjawed619@yahoo.com"; $mail->addaddress($address, "arsalan"); //$mail->addattachment("images/phpmailer.gif"); // attachment //$mail->addattachment("images/phpmailer_mini.gif"); // attachment if(!$mail->send()) { echo "mailer error: " . $mail->errorinfo; } else { echo "message sent!"; } ?>
any appreciated
you don't send emails pop3, retrieve them. send emails smtp example...
Comments
Post a Comment