Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Notice
- SMTP Error: data not accepted.
- Send Mail: Yes
- Mailer: SMTP
- From email: bluemonkmn@sgdk2.enigmadream.com
- From name: Benjamin Marty
- Disable Mass Mail: No
- SMTP Authentication: Yes
- SMTP Security: None
- SMTP Port: 25
- SMTP Username: bluemonkmn@sgdk2.enigmadream.com
- SMTP Password: (same password I used in the script below)
- SMTP Host: mail.sgdk2.enigmadream.com
- <?php
- /**
- * This example shows making an SMTP connection with authentication.
- */
- //SMTP needs accurate times, and the PHP timezone MUST be set
- //This should be done in your php.ini, but this is how to do it if you don't have access to that
- date_default_timezone_set('Etc/UTC');
- require 'PHPMailerAutoload.php';
- //Create a new PHPMailer instance
- $mail = new PHPMailer;
- //Tell PHPMailer to use SMTP
- $mail->isSMTP();
- //Enable SMTP debugging
- // 0 = off (for production use)
- // 1 = client messages
- // 2 = client and server messages
- $mail->SMTPDebug = 2;
- //Ask for HTML-friendly debug output
- $mail->Debugoutput = 'html';
- //Set the hostname of the mail server
- $mail->Host = "mail.sgdk2.enigmadream.com";
- //Set the SMTP port number - likely to be 25, 465 or 587
- $mail->Port = 25;
- //Whether to use SMTP authentication
- $mail->SMTPAuth = true;
- //Username to use for SMTP authentication
- $mail->Username = "bluemonkmn@sgdk2.enigmadream.com";
- //Password to use for SMTP authentication
- $mail->Password = "See Comment"; // I used the same password configured above
- //Set who the message is to be sent from
- $mail->setFrom('bluemonkmn@sgdk2.enigmadream.com', 'Benjamin Marty');
- //Set an alternative reply-to address
- $mail->addReplyTo('bluemonkmn@sgdk2.enigmadream.com', 'Benjamin Marty');
- //Set who the message is to be sent to
- $mail->addAddress('bluemonkmn@outlook.com', 'Ben Marty');
- //Set the subject line
- $mail->Subject = 'PHPMailer SMTP test';
- //if you want to include text in the body.
- $mail->Body = "This is a test of email";
- //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