Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $mail = new PHPMailer();
- $mail->IsSMTP();
- $mail->SMTPAuth = true;
- $mail->SMTPSecure = "ssl";
- $mail->Host = "Host";
- $mail->Port = 465;
- $mail->CharSet = 'UTF-8';
- $mail->Username ='user@mail.com'; //Email para enviar
- $mail->Password = '123'; //Su password
- //Agregar destinatario
- $mail->setFrom('user@mail.com', 'user name sender');
- $mail->AddAddress('cliente@mail.com');//A quien mandar email
- $mail->Subject = "Notificación";
- $mail->msgHTML ("<h1>Ejemplo contenido html</h1>");
- if(!$mail->send()) {
- echo 'Error al enviar email';
- echo 'Mailer error: ' . $mail->ErrorInfo;
- } else {
- echo 'Mail enviado correctamente';
- }
Add Comment
Please, Sign In to add comment