Before sending any email, you have to create a mailbox.
You will have to use SMTP authentication to send email. The “From” address of the message must match the SMTP authenticated user name. In other words, you can only send messages from the authenticated mailbox.
Here is a C# code snippet:
///The 'send from' mail address must match the SMTP user name.
String smtpUser = "Mailbox@providerdomain.com";
MailMessage msg = new MailMessage(smtpUser, "mail@somedomain.com");
msg.Body = "Some text";
msg.IsBodyHtml = true;
msg.Subject = "Some subject";
SmtpClient SMTP = new SmtpClient("smtp.providerdomain.com", 25);
SMTP.UseDefaultCredentials = false;
SMTP.EnableSsl = false;
SMTP.Credentials = new NetworkCredential()
{
UserName = smtpUser,
Password = "SomePassword"
};
SMTP.Send(msg);
```