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!!!
PHP Mail Funtion
Moderator: General Moderators
- superdezign
- DevNet Master
- Posts: 4135
- Joined: Sat Jan 20, 2007 11:06 pm
Re: PHP Mail Funtion
SwiftMailer. Try it.
- lonelywolf
- Forum Commoner
- Posts: 28
- Joined: Tue Jun 10, 2008 6:15 am
Re: PHP Mail Funtion
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
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!
I am not new to PHP but I am new to emailing from PHP scripts.
Thanks again!
- lonelywolf
- Forum Commoner
- Posts: 28
- Joined: Tue Jun 10, 2008 6:15 am
Re: PHP Mail Funtion
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.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!
- Attachments
-
- phpmailer.rar
- this is my phpmailer class.
- (12.82 KiB) Downloaded 11 times
Re: PHP Mail Funtion
Still not working.
I am running IIS on a windows server 2003 box. Does that help?
Thanks for all the help...appreciate it!
I am running IIS on a windows server 2003 box. Does that help?
Thanks for all the help...appreciate it!
- lonelywolf
- Forum Commoner
- Posts: 28
- Joined: Tue Jun 10, 2008 6:15 am
Re: PHP Mail Funtion
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.