Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require_once('/class.phpmailer.php');
- require_once('/class.pop3.php'); // required for 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 the message, please use an 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!";
- }
- ?>
- $pop->Authorise('smtp.mail.yahoo.com',465,10, 'arsalansherwani@yahoo.com',
- '******',1);
- <?php
- require_once('class.phpmailer.php');/*Including classes from php mailer*/
- require_once('class.pop3.php');
- require_once('class.smtp.php');
- $pop = new POP3(); /*Create a new object for pop3*/
- $pop->Authorise('mailserver001.mydomain.com', 110, 30, 'username', 'password', 1); /*login in to pop3 */
- $mail = new PHPMailer();
- $mail->IsSMTP();
- $mail->Debugoutput = 'html';
- $mail->SMTPDebug = 2;
- $mail->SMTPOptions = array(
- 'ssl' => array(
- 'verify_peer' => false,
- 'verify_peer_name' => false,
- 'allow_self_signed' => true)
- ); /*Skip SSL Errors(if any),generally not needed*/
- $mail->Host = 'mailserver001.mydomain.com'; /*SMTP host*/
- $mail->SetFrom('info@mydomain.com', 'Name');/*Email content */
- $mail->AddReplyTo("info@mydomain.com","Name");
- $mail->Subject = "Welcome";
- $mail->AltBody = "To view the message, please use an HTML compatible email viewer!";
- $mail->MsgHTML('HTML');
- $address = "myname@otherdomain.com";
- $mail->AddAddress($address, "Name");
- if(!$mail->Send()) {/*Send Email*/
- echo "Mailer Error: " . $mail->ErrorInfo;
- } else {
- echo "Message sent!";
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement