We setup a new email account via CPanel, and we tested that we can log into the webmail to send and receive emails of that account. We use this email account to send mails to our visitors to comlete the registration & activate their membership. However, on our website, we always see "mail has been successfully sent" but in fact, no one can receive that mails. Since the mail system is good, there seems to me some mistakes in relation to our scripts. And, our emails need to be athorizaed, here is the scripts, can any body advise that how to correct? Thanks in advance.

$smtpserver = "mail.xxx.com"; 
$port = 25 ; 
$smtpuser = "test0830@xxx.com";					
$smtppwd = "111111"; 
$mailtype = "HTML";					
$sender = "test0830@xxx.com";
$smtp  = new smtp($smtpserver,$port,true,$smtpuser,$smtppwd,$sender); 
$smtp->debug = true;					
$to = $UserName; 
$subject = "Active Your Account-xxx";
$body = "<html>
Member Avatar for langsor

Hi,

$smtp = new smtp is not a core php functionality, so I have no idea what it's doing that could influence if your script is correct or not.

With html email you need to make sure to set the content type to text/html in the email header.

Good luck

Here's a little tutorial on the subject of PHP email -- http://www.sitepoint.com/article/advanced-email-php

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.