How do I send mail from my website on Windows shared services?

Sending mail from your website(s) is very easy with us! Simply set your sites SMTP server to one of the below SMTP servers and that is all! We’ve disabled our primary mail server systems from accepting mail from our web servers, these mail servers are dedicated for website email and allow us to better control website email.

The following server hosts are available to send mail for our web servers and other ASPnix-hosted systems

  • (no authentication required)

The following ports are available for SMTP connections

  • 25
  • 465 (SSL)
  • 587 (TLS)

Note that the PHP mail method / function is not available on our servers, it has been disabled for security purposes. We recommend though that you do not use the built in PHP mail delivery method as it is unreliable and emails sent through this method are known to be flagged as spam, please use a direct SMTP mailer such as PHPMailer or Swift Mailer.

These SMTP servers will only send mail for servers within our web hosting network, you will not be able to send mail from an external host, a local development machine, or any 3rd party email clients such as Outlook.

Below are some code samples of various languages to get you started!

ASP.Net (C#)

MailMessage mail = new MailMessage();
SmtpClient SmtpServer = new SmtpClient("");
mail.From = new MailAddress("from@yourdomain");
mail.Subject = "Test Mail";
mail.Body = "This is for testing SMTP mail";

ASP.Net (VB)

Dim SmtpServer As New SmtpClient("")
Dim mail As New MailMessage()
mail = New MailMessage()
mail.From = New MailAddress("from@yourdomain")
mail.Subject = "Test Mail"
mail.Body = "This is for testing SMTP mail"

Classic ASP (CDOSYS)

Dim ObjSendMail
Set ObjSendMail = CreateObject("CDO.Message") 
ObjSendMail.Configuration.Fields.Item("") = 2
ObjSendMail.Configuration.Fields.Item("") = ""
ObjSendMail.Configuration.Fields.Item("") = 25
ObjSendMail.Configuration.Fields.Item("") = 60
ObjSendMail.To = "to@theirdomain"
ObjSendMail.Subject = "this is the subject"
ObjSendMail.From = "from@yourdomain"
ObjSendMail.TextBody = "this is the body" 
Set ObjSendMail = Nothing 

Classic ASP using Persits Mailer

Please note that Persits requires 32-bit application pools, make sure this has been set for your website.

Set Mail = Server.CreateObject("Persits.MailSender")
Mail.Host = ""
Mail.Port = 25
Mail.From = "from@yourdomain"
Mail.FromName = "Your Name" ' Optional
Mail.AddAddress "to@theirdomain", "Their Name"
Mail.Subject = "Message Subject"
Mail.Body = "This is a message sent through Persits Mailer"
Set Mail = Nothing

PHP using PHPMailer

$mail = new PHPMailer();
$mail->Host = '';
$mail->Port = 587;
$mail->SMTPAutoTLS = true;
$mail->setFrom('from@yourdomain', 'Your Name');
$mail->addAddress('to@theirdomain', 'Their Name');
$mail->Subject = 'First PHPMailer Message';
$mail->Body = 'Hi! This is my first e-mail sent through PHPMailer.';
  echo 'Message was not sent.';
  echo 'Mailer error: ' . $mail->ErrorInfo;
  echo 'Message has been sent.';

PHP using SwiftMailer

setFrom(['from@yourdomain' => 'Your Name'])
    ->setTo(['to@theirdomain' => 'Their Name'])
    ->setBody('Here is the message itself');
$result = $mailer->send($message);

25 thoughts on “How do I send mail from my website on Windows shared services?”

    • Thank you for your comment.

      I assume you mean a code samples. Unfortunately we do not provide any code samples, if you are looking for code samples I would recommend looking at the languages documentation / website for more help. has many complete samples and there are many websites dedicated to .NET.

  1. It’s pretty straight forward and simple in using the SMTP server Set the from address and SMTP server in web.config and then instantiate SMPTClient in your code.

    In web.config, set SMTP settings:

    In code behind for web page (C#)

    SmtpClient smtp = new SmtpClient();

    // Create message with your email and the send to email address

    MailMessage msg = new MailMessage(new System.Net.Mail.MailAddress(""), new System.Net.Mail.MailAddress(""));
    msg.Subject = "Confirmation Email";
    msg.Body = "Yada Yada Yada - message body";


  2. Web.config setting – with gt & lt removed from tags
    -smtp from=””-
    -network host=”MAILLIST_HOST_NAME” port=”25″ userName=”” password=”” /-

  3. Make sure you are not using just

    Use the one allocated for your account / location. (USA) (Germany)

    The hostname may not work in the future.

  4. Hello,

    No these settings are still valid. The maillist servers are still correct, make sure though that your script is not supplying a username / password. This should not be set for these servers.

  5. Christopher, can you please elaborate on how to set-up the plug-in? Our web admin installed the plug-in but said he has no idea how to set it up based on this article. Any clarification is appreciated.

    • @Susan vinci-lucero – There is not much too it… Install it and use the SMTP host specified above for your data-center location. As the article states, no authentication is required.

  6. This doesn’t work at all, I just get an error 500…

    Dim ObjSendMail
    Set ObjSendMail = CreateObject(“CDO.Message”)

    ObjSendMail.Configuration.Fields.Item (“”) = 0
    ObjSendMail.Configuration.Fields.Item (“”) = “”
    ObjSendMail.Configuration.Fields.Item (“”) = 25
    ObjSendMail.Configuration.Fields.Item (“”) = 60

    ObjSendMail.To = “toemailaddress”
    ObjSendMail.Subject = “this is the subject”
    ObjSendMail.From = “fromemailaddress”

    ObjSendMail.HTMLBody = “this is the body”
    ObjSendMail.TextBody = “this is the body”


    Set ObjSendMail = Nothing

  7. Set myMail=CreateObject(“CDO.Message”)
    myMail.Subject=”Sending email with CDO”
    myMail.TextBody=”This is a message.”
    myMail.Configuration.Fields.Item _
    ‘Name or IP of remote SMTP server
    myMail.Configuration.Fields.Item _
    ‘Server port
    myMail.Configuration.Fields.Item _
    set myMail=nothing

  8. I’m using this code in a Web API project, but \every time I try to send an email by calling the service method I get either this error when using port 587:

    “The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.7.0 Authentication required”

    or this error when using port 465 (with SSL enabled):

    “Client does not have permission to submit mail to this server. The server response was: 4.3.3 TLS not available: error generating SSL handle”

    Any idea why? I’m not passing in any authentication, as you’ve stated it’s not required, but these errors seem to indicate that it IS required…? Thanks for your help!

  9. I can’t send email from a website.
    It was works properly when the server was in Germany. Today the server is in USA, and it does not works anymore.
    I changed SMTP address from “” to “”, but this does not solve.

    I try SMTP service with this simplest code:

    using (var smtpClient = new System.Net.Mail.SmtpClient(“”)) {
    var testAddress = “”;
    using (var message = new System.Net.Mail.MailMessage(testAddress, testAddress, “Test email”, “Trying to send a test email”)) {

    I receive this error:
    A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond

    Any idea?

    Thanks very much

  10. it’s not working Christopher. i get the unable to connect server. if i try in locally, it’s working. but, in web site, it s NOT WORKING….

    our code:

    MailMessage msgMail = new MailMessage();
    msgMail.To.Add(new MailAddress(“”, “Ercan Erkü”));
    msgMail.From = new MailAddress(“”);
    msgMail.Subject = “”;
    msgMail.Body = “denemedir.”;
    msgMail.IsBodyHtml = true;

    SmtpClient smtp = new SmtpClient(“”, 587);
    smtp.EnableSsl = false;

    if (smtp_username.Length > 0)
    smtp.Credentials = new NetworkCredential(smtp_username, smtp_password);


  11. is the same as, they are one in the same. The mlxx naming scheme is older when we had multiple servers, but there is no need for multiples since we have multiple outgoing gateways that handle mail. Your app will continue working just fine on

Comments are closed.