Advertisement
Advertisement
| 08.08.2008 at 03:38AM PDT, ID: 23632224 | Points: 500 |
|
[x]
Attachment Details
|
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: |
<?php
require("phpmailer/class.phpmailer.php");
IsSMTP(); // send via SMTP
$mail->SMTPAuth = true; // turn on SMTP authentication
$mail->Username = "username@googlemail.com"; // SMTP username
$mail->Password = "my password"; // SMTP password
$webmaster_email = "ciaran@mydomain.com"; //Reply to this email ID
$email="username@domain.com"; // Recipients email ID
$name="name"; // Recipient's name
$mail->From = $webmaster_email;
$mail->FromName = "Webmaster";
$mail->AddAddress($email,$name);
$mail->AddReplyTo($webmaster_email,"Webmaster");
$mail->WordWrap = 50; // set word wrap
$mail->AddAttachment("/var/tmp/file.tar.gz"); // attachment
$mail->AddAttachment("/tmp/image.jpg", "new.jpg"); // attachment
$mail->IsHTML(true); // send as HTML
$mail->Subject = "Demo Request";
$mail->Body=$_POST['Name']
$mail->Body=$_POST['CompanyName']
$mail->Body=$_POST['EmailFrom']
$mail->Body=$_POST['Telephone']
$mail->Body=$_POST['AdditionalInfo']
if(!$mail->Send())
{
echo "Mailer Error: " . $mail->ErrorInfo;
}
else
{
echo "Message has been sent";
}
?>
|