Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- define('PHPMAILERHOST', 'smtp.sparkpostmail.com');
- $phpmailer_smtpuser = 'SMTP_Injection';
- $phpmailer_smtppassword = '<API_KEY>';
- define('PHPMAILERPORT', 587);
- $config['mailtype'] = "html";
- $config['protocol'] = 'smtp';
- $config['smtp_host'] = 'smtp.sparkpostmail.com';
- $config['smtp_user'] = 'user';
- $config['smtp_pass'] = 'password';
- $config['smtp_crypto'] = 'tls';
- $config['smtp_port'] = '587';
- $condig['crlf'] = "rn";
- $config['newline'] = "rn";
- //Sparkpost configuration
- $config['mailtype'] = "html";
- $config['protocol'] = 'smtp';
- $config['smtp_host'] = 'smtp.sparkpostmail.com';
- $config['smtp_user'] = 'user';
- $config['smtp_pass'] = 'password';
- $config['smtp_crypto'] = 'tls';
- $config['smtp_port'] = '587';
- $condig['crlf'] = "rn";
- $config['newline'] = "rn";
- //My email code
- $to_email = "$Email";
- $from_email = "me@mydomain";
- $subject = "Email Subject";
- $comment = "<html>Email message</html>";
- // Always set content-type when sending HTML email
- $headers = "MIME-Version: 1.0" . "rn";
- $headers .= "Content-type:text/html;charset=UTF-8" . "rn";
- // More headers
- $headers .= "From: Info <" . $from_email . ">rn";
- //send email
- mail($to_email, "$subject", $comment, $headers);
- $mail = new PHPMailer;
- $mail->SMTPDebug = 3;
- $mail->isSMTP();
- $mail->Host = 'smtp.sparkpostmail.com';
- $mail->Port = 587;
- $mail->SMTPSecure = 'tls';
- $mail->SMTPAuth = true;
- $mail->Username = 'SMTP_Injection';
- $mail->Password = '<API_KEY>'; //make sure you add SMTP permission to API Key
- $mail->setFrom('testing@sparkpostbox.com'); //you can use w/o adding your sending domain like ~50 messages. Once you add your sending domain, use that.
- $mail->addAddress('recipient@domain.com');
- $mail->Subject = 'Test subject';
- $mail->Body = 'Hello World!';
- $mail->send();
Add Comment
Please, Sign In to add comment