NOTE: This article is for Window Hosting Only. For Linux Hosting, please refer to here.
You need to:
1. use your email server as the smtp, this is usually mail.yourdomain.com
2. authenticate to the smtp server
3. make sure your "From" address is exactly the same as your login address in NetworkCredential class
Sample php code using aspemail COM+. (aspemail COM+ is supported by our hosting)
<?php
$mailer = new COM("Persits.MailSender") or die("Unable to instantiate aspemail");
echo $mailer->version;
$smtp = "mail.sender.com";
$from = "info@sender.com";
$login = "info@sender.com";
$pwd = "password";
$to = "tom@recipient.com";
$subject = "Subject";
$body = "This is message body";
$mailer->Host = $smtp;
$mailer->Username = $login;
$mailer->Password = $pwd;
$mailer->From = $from; // From address
$mailer->AddAddress($to);
$mailer->Subject = $subject;
$mailer->Body = $body;
$mailer->Send() or die("failed");
unset($mailer);
?>
If the above sample code does not work you can try the pure php variant from http://phpmailer.sourceforge.net/. Sample code can be found here.