Our SMTP servers require that you pass SMTP authentication before relaying email from a php application. You can use the code below to define SMTP authentication.
<html> <head><title>Test email via php</title></head> <body> <?php require_once "Mail.php"; $from = "Sender <postmaster@YourHostedDomainName.com>"; $to = "Recipient <user@YourHostedDomainName.com>"; $subject = "This is a test email sent via php"; $body = "This is a test email"; $host = "[Mail Server Name]"; $username = "postmaster@YourHostedDomainName.com"; $password = "email_password"; $headers = array ('From' => $from, 'To' => $to, 'Subject' => $subject); $smtp = Mail::factory('smtp', array ('host' => $host, 'auth' => true, 'username' => $username, 'password' => $password)); $mail = $smtp->send($to, $headers, $body);echo "mail sent"; ?> </body> </html>
If you run into problems when using this code, please post in the DiscountASP.NET or Everleap community forum. Technical support is unable to assist with specific coding issues.
Trouble logging in? Simply enter your email address OR username in order to reset your password.
For faster and more reliable delivery, add support@discountasp.net to your trusted senders list in your email software.