Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'phpmailer/PHPMailerAutoload.php';
- if(isset($_POST['submit'])) {
- $mail = new PHPMailer;
- $firstName = $_POST['firstName'];
- $lastName = $_POST['lastName'];
- $email = $_POST['email'];
- $subject = $_POST['subject'];
- $message = $_POST['message'];
- $mail->isSMTP();
- $mail->Host = 'mailout.one.com';
- $mail->SMTPAuth = true;
- $mail->Username = 'myemail@one.com';
- $mail->Password = 'mypassword';
- $mail->SMTPSecure = 'tls';
- $mail->Port = 465;
- $mail->AddReplyTo($email, $firstName);
- $mail->setFrom($email, $firstName);
- $mail->addAddress('example@gmail.com', 'the name');
- $mail->isHTML(true);
- $mail->Subject = $_POST['subject'];
- $mail->Body = '<b>From:</b><br> ' . $firstName . ' ' . $lastName . '<br> <br> <b>Message:</b> <br> ' .$message;
- $mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
- $mail->SMTPDebug = 3;
- $mail = new PHPMailer;
- $mail->Host = 'mailout.one.com';
- $mail->SMTPAuth = true;
- $mail->Username = '***************';
- $mail->Password = '************';
- $mail->SMTPSecure = false;
- $mail->Port = 25;
- /*be careful with the one.com servers strict case sensitivity
- renaming the file PHPMailerAutoload.php to phpmailerautoload.php could do the trick, but you need to require it in lower case as well:*/
- require_once 'phpmailer/phpmailerautoload.php';
- $mail = new PHPMailer; //don't use brackets here!
- $mail->IsSMTP();
- $mail->SMTPAuth = true;
- $mail->SMTPSecure = "tls";
- $mail->Host = "send.one.com";
- $mail->Port = 587;
- $mail->Username = "**toChangeTp**your webemail-username";
- $mail->Password = "**toChangeTp**your webmail-passwort";
- $useExceptions = true;
- $mail = new PHPMailer( $useExceptions );
- try {
- $mail->isSMTP();
- $mail->Host = 'send.one.com';
- $mail->SMTPAuth = true;
- $mail->Username = 'xxx@yyy.zz'; // Replace by your SMTP username
- $mail->Password = 'xxx123489'; // Replace by your SMTP password
- $mail->SMTPSecure = 'tls';
- $mail->Port = 587;
- ...
- $mail->setFrom('Your email-fromaddress>'); // Replace
- $mail->addAddress('Your to address'); // Replace
- $mail->addReplyTo('Your Reply Address'); // Replace
- ...
- $mail->isHTML(true);
- $mail->Subject = 'Your Subject';
- $mail->Body = 'Your body';
- $mail->AltBody = 'Your plain text body';
- ...
- $mail->send();
- } catch (Exception $e) {
- ...
- }
Add Comment
Please, Sign In to add comment