I have a C# application that sends email notifications to users. I am trying to use the application to send text alerts as well (for reminders, mostly). Our provider is Verizon, so it is possible to send an Email as a text message, by emailing with the format: [email protected].
I've set my up application (which successfully sends emails to actual email addresses) with some phone numbers for testing, and the text messages are never recived. I can, however, successfully send emails as text messages through corporate mail accounts (we use Lotus Notes), and from my personal GMail account.
I'm not getting any errors...The text messages just never arrive. The code looks as such
public void SendMail(string address, string contents)
{
try
{
MailMessage mailMessage = new MailMessage();
mailMessage.To.Add(address);
mailMessage.From = new MailAddress("email name removed");
mailMessage.Subject = "System Notification";
mailMessage.Body = contents;
SmtpClient smtpClient = new SmtpClient("client name removed");
Console.WriteLine("Mail sent to: " + address + "\n--> "
+ contents + "\n");
smtpClient.Send(mailMessage);
}
catch (Exception)
{ }
}
Then, I call the method like so:
emailService.SendMail("[email protected]", message);