I have no trouble sending emails through my website hosted at home but I have a helpdesk ticket system which counts on the php.ini mail settings to run so i need to setup phpmailer
I have read a lot of articles on the phpmailer but none of them helped me out. Here is my situation. I run a web server from my house using Web developer controller it's like xamp server.
My php and apache run under my c:\www\ folder also my website is in that folder in c:\www\vhost\localhost.
The instruction say to Copy class.phpmailer.php into your php.ini include_path
The first question is where should I copy the files I downloaded for phpmailer? Should the folder with the files in it be copied under my localhost directory or maybe in the c:\www\php5\ directory?
The second question is the most important. I opened up my php.ini file but what exactly goes here?
; Windows: "\path1;\path2"
;include_path = ".;c:/php/includes/"
include_path = ????????? does this depend where i copied my class.phpmailer.php file to?
So if the class.phpmailer.php file is under my c:\www\vhost\localhost directory would it look like this.
include_path = ".;c:/www/vhost/localhost/"
I am wondering if i should keep the file class.phpmailer.php in the phpmailer folder instead of taking it out and placing it in the localhost directory? so it would look like this c:\www\vhost\localhost\phpmailer\
Do I need to change this or get rid of it for phpmailer to work
[mail function]
; For Win32 only.
SMTP = localhost
smtp_port = 25
The third question. Do I also add this to the php.ini file?
<?php
require("class.phpmailer.php");
$mail = new PHPMailer();
$mail->IsSMTP(); // set mailer to use SMTP
$mail->Host = "smtp1.example.com;smtp2.example.com"; // specify main and backup server
$mail->SMTPAuth = true; // turn on SMTP authentication
$mail->Username = "jswan"; // SMTP username
$mail->Password = "secret"; // SMTP password
$mail->From = "from@example.com";
$mail->FromName = "Mailer";
$mail->AddAddress("josh@example.net", "Josh Adams");
$mail->AddAddress("ellen@example.com"); // name is optional
$mail->AddReplyTo("info@example.com", "Information");
$mail->WordWrap = 50; // set word wrap to 50 characters
$mail->AddAttachment("/var/tmp/file.tar.gz"); // add attachments
$mail->AddAttachment("/tmp/image.jpg", "new.jpg"); // optional name
$mail->IsHTML(true); // set email format to HTML
$mail->Subject = "Here is the subject";
$mail->Body = "This is the HTML message body <b>in bold!</b>";
$mail->AltBody = "This is the body in plain text for non-HTML mail clients";
if(!$mail->Send())
{
echo "Message could not be sent. <p>";
echo "Mailer Error: " . $mail->ErrorInfo;
exit;
}
echo "Message has been sent";
?>
Any help would be appreciated.