<?php
$txt = "First line of text\nSecond line of text";
// Use wordwrap() if lines are longer than 70 characters
$txt = wordwrap($txt,70);
// Send email
mail("[email protected]","My subject",$txt);
?>

$ cat /home/frisco/.msmtprc account default host smtp.gmail.com port 587 timeout 30 auth on user [email protected] password ****** auto_from off from [email protected] maildomain domain.com tls on tls_starttls on tls_trust_file /etc/ssl/certs/ca-certificates.crt logfile /var/log/msmtp.log
<?php
include("class.phpmailer.php");
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->SMTPAuth = true; // enable SMTP authentication
$mail->SMTPSecure = "ssl"; // use ssl
$mail->Host = "smtp.gmail.com"; // GMAIL's SMTP server
$mail->Port = 587; // SMTP port used by GMAIL server
$mail->Username = "[email protected]"; // GMAIL username
$mail->Password = "******"; // GMAIL password
$mail->AddReplyTo("[email protected]","Firstname Lastname"); // Reply email address
$mail->From = "[email protected]";
$mail->FromName = "Firstname Lastname"; // Name to appear once the email is sent
$mail->Subject = "Subject of the email"; // Email's subject
$mail->Body = "Hello World,<br />This is the HTML BODY<br />"; //HTML Body
//$mail->AltBody = "This is a test email"; // optional, comment out and test
$mail->WordWrap = 50; // set word wrap
//$mail->MsgHTML($body); // [optional] Send body email as HTML
$mail->AddAddress("[email protected]", "company"); // email address of recipient
//$mail->AddAttachment("files/files.zip"); // [optional] attachment
//$mail->IsHTML(true); // [optional] send as HTML
if(!$mail->Send())
echo "Mailer Error: " . $mail->ErrorInfo;
else
echo "Message sent!";
?>