I am trying to send a test email from my IIS it has SMTP installed, but I am confused how to use IP address to send email.
Here is my code
SmtpClient m = new SmtpClient();
m.Host = "xxx.xxx.xxx.xxx"; // my IP address.
m.Port = 25;
m.Send("xxx.xxx.xxx.xxx", "mymailID@gmail.com", "Test", "This is a test email.....");
This code giving error
The specified string is not in the form required for an e-mail
address.
UPDATE
I am new to email sending concept.
You need the from address:
Documentation Send(string, string, string, string)
Chances are you’ve received email from
robot@domain.comwith instructionsIt seems like this would be your best bet, depending on if your mail server wants an authenticate address or not. For example, http://www.domainY.com, will only send domainY.com email address. There can be a lot of rules or no rules, but that can be for another time.