Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require("class.phpmailer.php");
- $mail = new PHPMailer()
- $mail->From = "sender@gmail.com";
- $mail->AddAddress("recipient@gmail.com"); // name is optional
- $mail->AddReplyTo("sender@gmail.com");
- $mail->WordWrap = 50; // set word wrap to 50 characters
- $mail->IsHTML(true); // set email format to HTML
- $mail->Subject = "Here is the subject";
- $mail->Body = "This is the HTML message body <b>in bold!</b>";
- $mail->AltBody = "This is the body in plain text for non-HTML mail clients";
- if(!$mail->Send())
- {
- echo "Message could not be sent. <p>";
- echo "Mailer Error: " . $mail->ErrorInfo;
- exit;
- }
- echo "Message has been sent";
- //$mail->IsSMTP(); // is this necessary?
- //$mail->Host = "some host ip"; // what i need to write here?
- //$mail->SMTPAuth = true; // is this necessary to send email NOT as spam?
- //$mail->Username = "test"; // and this?
- //$mail->Password = "secret"; // and this?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement