The following is a working sample of how to send mail with .Net (C#) on our hosting accounts. Please note that we do not provide support for this sample. It is only provided as a guide to help you get started.
Since .Net framework uses Microsoft SMTP server which is not our default mail server, you have to open a support ticket for us, to request permission to use Microsoft SMTP server from your script.
This is what the C# code looks like:
using System;
using System.Web.Mail;
namespace Mail {
/// <summary>
/// A class for demonstrating sending mail from C#
/// </summary>
class MailClass {
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main(string[] args) {
MailMessage message = new MailMessage();
// The sender of the email
message.From = "me@mydomain.com";// The recipient of the email
message.To = "he@hisdomain.com";
message.Subject = "this is the subject of the mail";
message.Body = "this is the body of the mail";SmtpMail.SmtpServer = "mail.yourdomain.com";
SmtpMail.Username = "me@mydomain.com"
SmtpMail.Password = "password"SmtpMail.Send(message);
}
}
}