Page 1 of 1
PHP Mail Funtion
Posted: Thu Jun 12, 2008 1:58 am
by kerepuki
Hi,
I am trying to get PHP to send an email but everything I try fails.
I have done the examples and tutorials about the phpmailer() and that didnt work.
I dont want to set up SMTP on my server so could someone please help. Let me know what info I will need to post to get started.
Many thanks!!!
Re: PHP Mail Funtion
Posted: Thu Jun 12, 2008 5:46 am
by superdezign
Re: PHP Mail Funtion
Posted: Thu Jun 12, 2008 6:25 am
by lonelywolf
i started using phpmailer for 3 days ago, i think it quite simple. Maybe you tutorial is not clearly, this is my code for using phpmailer class. First, instance the class, sencond, assign some properties and send. Maybe it'll help you:
Code: Select all
require_once "classes/phpmailer.php";
//send mail to client
$mail = new PHPMailer();
$mail->From = WEBSITEEMAIL;
$mail->FromName = "ABC website";
$contents = "<b>html contents here</b>";
$mail->Subject = 'mail subject' ;
$to = $mailTo ;
$mail->MsgHTML($contents);
$mail->AddAddress($to, $to);
$mail->Send();
Re: PHP Mail Funtion
Posted: Thu Jun 12, 2008 4:49 pm
by kerepuki
Thanks for the replies, question, are there any settings I need to change in the phpmailer file? Server setting etc?
I am not new to PHP but I am new to emailing from PHP scripts.
Thanks again!
Re: PHP Mail Funtion
Posted: Thu Jun 12, 2008 10:43 pm
by lonelywolf
kerepuki wrote:Thanks for the replies, question, are there any settings I need to change in the phpmailer file? Server setting etc?
I am not new to PHP but I am new to emailing from PHP scripts.
Thanks again!
You don't need to change any settings. After including phpmailer class. Just instance and assign properties. You can simply using mail() function to check whether send mail functions correctly.
Re: PHP Mail Funtion
Posted: Fri Jun 13, 2008 12:28 am
by kerepuki
Still not working.
I am running IIS on a windows server 2003 box. Does that help?
Thanks for all the help...appreciate it!
Re: PHP Mail Funtion
Posted: Fri Jun 13, 2008 1:48 am
by lonelywolf
you're running for testing? My server is running linux with apache. If you're running localhost for testing only, i think there is something to install on your system to play with send mail functions.