you cannot connect to an smtp server and send email using the mail() and imap_mail(). you will have to connect to your smtp server using fsocketopen, setup a stream and then send emails through that. it takes some very advanced php coding skills to acomplish that task. i suggest you use phpmailer. all the hard part is taken care of by the class. for example, i did not want to write a complicated php script just to handle a simple contact forum on my website clarifyloans.com. so, i just uploaded the class to my website, and add this code:
$mail = new PHPMailer();
$mail->IsSMTP(); // send via SMTP
$mail->Host = $settings['smtpserver']; // SMTP servers
$mail->SMTPAuth = true; // turn on SMTP authentication
$mail->Username = $settings['user']; // SMTP username
$mail->Password = $settings['password']; // SMTP password
$mail->From = $emailaddr['post'] ;
$mail->FromName = "Clarify Loans Contact Form";
$mail->AddAddress($settings['adminemail'],"John Phillips"
$mail->AddReplyTo($settings['adminemail'],"Information"
$mail->WordWrap = 50; // set word wrap
$mail->IsHTML(false); // send as HTML
$mail->Subject = $subj['post'];
$mail->Body = $message['post'];
$mail->AltBody = $message['post'];
if(!$mail->Send())
{
echo "Message was not sent <p>";
echo "Mailer Error: " . $mail->ErrorInfo;
exit;
}
echo "Message has been sent"; this is way easier than write a code to connect to smtp server.
CyberSpatium----------------------WAMP English Forum Admin
Need help? Check out my
WAMP User Manual/Guide here!
Cellular Phone Deals - The Best on the Net! -
FREE PHONES! Take your pick from our featured cellular phone deals by Cingular, Verizon, T-Mobile, Sprint PCS, Nextel, and more! Most of our cellular phone offers include a
FREE cellular phone with
FREE shipping!
Web Development for Newbie's Blog - Check out my new blog. It is for web developers, and especially tailored for the web development newbie. If you are not fluent in geek speak, then this incredible resource is just you. And even if you are a web development pro, this is a great resource to check out some of the latest web development tips, news, tutorials, codes and more.
Mortgage and Home Loan Advice:Clarify Loans