Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // add mail function
- //Create a new PHPMailer instance
- $mail = new PHPMailer(true);
- // Set PHPMailer to use the sendmail transport
- $mail->isSendmail();
- //Set who the message is to be sent from
- $mail->setFrom('xxxxxx@yyyyy.com');
- //Set an alternative reply-to address
- // $mail->addReplyTo('replyto@example.com', 'First Last');
- //Set who the message is to be sent to
- $mail->addAddress('xxxxxx@wyyyyy.com');
- //Set the subject line
- $mail->Subject = 'Rework Report';
- $mail->Body = 'Here is the weekly rework report.';
- //Attach an image file
- $mail->addAttachment('current/rework.txt');
- //send the message, check for errors
- if (!$mail->send()) {
- echo "Mailer Error: " . $mail->ErrorInfo;
- } else {
- echo "Message sent!";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement