Código PHP:
require_once('PHPMailer/class.phpmailer.php');
$mail = new PHPMailer();
$body = "Aqui va el body";
$mail->IsSMTP(); // telling the class to use SMTP
$mail->Host = "smtp.1and1.com"; // SMTP server
//$mail->SMTPAuth = true; // enable SMTP authentication
//$mail->Port = 587; // set the SMTP
$mail->Username = "[email protected]"; //username
$mail->Password = "mipassword"; //password
$mail->SetFrom('[email protected]', 'Nombre');
$mail->AddReplyTo('[email protected]', 'Nombre');
$mail->Subject = "Subject";
$mail->AltBody = "Opcional"; // optional, comment out and test
$mail->MsgHTML($body);
$mail->AddAddress('[email protected]', 'Destinatario');
if(!$mail->Send()) {
echo "Mailer Error: " . $mail->ErrorInfo;
} else {
echo "Message sent!";
}
Alguien me puede echar una mano?