Knowledgebase
How do I send email with PHPMailer for Windows Hosting?
Posted by Phil (Netcetera) on 25 April 2012 06:03 PM
Please see this link for more information regarding this PHP mail component. 
http://phpmailer.sourceforge.net 

Special Note 
Be sure to make the following changes when using this coding example: 
1. Replace YourDomain.com with a valid Netcetera hosted domain name. 
2. Replace you@domain.com with a valid Netcetera hosted email account. 
3. Replace password with the password for the email account used above. 
4. Replace user@domain.com with a valid email account. 

**Your FROM address must be the same as the email address you authenticate with.**
 


<?

require("c:\php\includes\class.phpmailer.php"); 

$mail = new PHPMailer(); 

$mail->IsSMTP();
$mail->Host = "mail.netcetera.co.uk";
$mail->SMTPAuth = true;
$mail->Username = "you@domain.com";
$mail->Password = "EmailPassword";

$mail->From = "you@domain.com";
$mail->FromName = "Your Name";
$mail->AddReplyTo("you@domain.com");
$mail->AddAddress("user@domain.com");
$mail->IsHTML(true);
$mail->Subject = "Test message sent using the PHPMailer component";
$mail->Body = "This is a test message.";
$mail->Send();

?>


Attached is a sample that includes a form. Copy and paste the code from the attached into a PHP page and make the appropriate changes to the mail server, email addresses, and password. 




Attachments 
 
(6 vote(s))
Helpful
Not helpful

Comments (0)
Post a new comment
 
 
Full Name:
Email:
Comments:
CAPTCHA Verification 
 
Please enter the text you see in the image into the textbox below (we use this to prevent automated submissions).