Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <title> MY MAIL </title>
- </head>
- <?php
- $account="abc@outlook.com";
- $password="****";
- $to="xyz@outlook.com";
- $from="abc@outlook.com";
- $from_name="ABC";
- $msg="Hello";
- $subject="Hello World";
- include("phpmailer/class.phpmailer.php");
- $mail = new PHPMailer();
- $mail->IsSMTP();
- $mail->CharSet = 'UTF-8';
- $mail->Host = "smtp.live.com";
- $mail->SMTPAuth= true;
- $mail->Port = 587;
- $mail->Username= $account;
- $mail->Password= $password;
- $mail->SMTPSecure = 'tls';
- $mail->From = $from;
- $mail->FromName= $from_name;
- $mail->isHTML(true);
- $mail->Subject = $subject;
- $mail->Body = $msg;
- $mail->addAddress($to);
- $mail->SMTPDebug = 1;
- if(!$mail->send()){
- echo "Mailer Error: " . $mail->ErrorInfo;
- }else{
- echo "E-Mail has been sent";
- }
- ?>
- <body>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement