Base de conocimientos · Correo electrónico
Envío de correo electrónico (SMTP) con PHPMailer
Última actualización: 2020-04-05
1) En primer lugar, descargue las PHP Mailer clases y la documentación.
2) Suba class.smtp.php y class.phpmailer.php a su espacio web.
3) Cree test.php e inserte el siguiente código dentro del archivo
<?
require ('class.phpmailer.php');
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->From = "mail@domain.com";;
$mail->FromName = "Your Name";
$mail->Host = 'mail.domain.com';
$mail->SMTPAuth = true;
$mail->Username = 'mail@domain.com';
$mail->Password = '********';
$mail->AddAddress("dest@domain.com", "His name");
$mail->Subject = "Here is the subject";
$mail->Body = "This is the message body";
if($mail->Send())
{
echo "email sent";
exit;
}
echo "There was an error sending the message";
?>
4) Reemplace los parámetros
5) Ejecute test.php
2) Suba class.smtp.php y class.phpmailer.php a su espacio web.
3) Cree test.php e inserte el siguiente código dentro del archivo
<?
require ('class.phpmailer.php');
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->From = "mail@domain.com";;
$mail->FromName = "Your Name";
$mail->Host = 'mail.domain.com';
$mail->SMTPAuth = true;
$mail->Username = 'mail@domain.com';
$mail->Password = '********';
$mail->AddAddress("dest@domain.com", "His name");
$mail->Subject = "Here is the subject";
$mail->Body = "This is the message body";
if($mail->Send())
{
echo "email sent";
exit;
}
echo "There was an error sending the message";
?>
4) Reemplace los parámetros
5) Ejecute test.php
Tell us what you need
Compare available plans or describe your workload so we can discuss a suitable starting point.