| Server IP : 159.223.102.202 / Your IP : 216.73.216.193 Web Server : nginx/1.26.0 System : Linux Gen1-cloudpanel2ubuntu2404-1vcpu-1gb-nyc1-01 6.8.0-31-generic #31-Ubuntu SMP PREEMPT_DYNAMIC Sat Apr 20 00:40:06 UTC 2024 x86_64 User : albasshbotta ( 1021) PHP Version : 8.2.19 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /home/bottaingenieriaUep/htdocs/www.bottaingenieria.com.ar/licen/ |
Upload File : |
<html>
<head>
<title>Ejemplo para mandar un mail</title>
</head>
<body>
<?php
//incluir clase
require_once('../clases/class.phpmailer.php');
//crear objeto mail
$mail = new PHPMailer(); // defaults to using php "mail()"
//asignarle contenido... un string con codigo html o un archivo... q contenga una estructura <body>...</body>
//$body = file_get_contents('contents.html');
//$body = eregi_replace("[\]",'',$body);
$body = "<body><h1>Miren que lindo que salio el email</h1></body>";
//fijar destinatario/s
$mail->AddAddress("hernanbotta@gmail.com", "Hernan");
//fijar a quien responder
$mail->AddReplyTo("hernan@bottaingenieria.com.ar","Contacto");
//fijar quien lo mando! esto esta especial para pescar despistados
$mail->SetFrom('hernan@bottaingenieria.com.ar', 'Contacto');
//fijar Copia Carbon Oculta - esto no me anduvo
//$mail->AddBCC('contacto@rosmusica.com.ar', 'Contacto');
//Asunto
$mail->Subject = "Promocion Imperdible";
//cuerpo alternativo si el cliente de email no soporta html
$mail->AltBody = "To view the message, please use an HTML compatible email viewer!";
$mail->MsgHTML($body);
//Adjuntos
//$mail->AddAttachment("images/phpmailer.gif"); // attachment
//$mail->AddAttachment("images/phpmailer_mini.gif"); // attachment
//Mandar (estando en localhost les va a abrir un bello popup con el mail enviado)
//devuelve true o false segun se mande correctamente...
if(!$mail->Send()) {
echo "Mailer Error: " . $mail->ErrorInfo; //captura excepcion
} else {
echo "Message sent!";
}
// y listo!
?>
</body>
</html>