I am new to SMTP and IIS settings, but according to the documentation read on the Internet, this should work.
What I'm trying to achieve:
To send an email from the server to the users email address using the existing SMTP relay server.
What I did:
In my IIS for my site (ASP.NET), I set up SMTP email. I entered:
- A random email address (it doesn't have to be an existing one, right?)
- IP address of the SMTP server (in this case, the IP address of the external SMTP relay server)
- Port Number (25).
- Authentication settings to "Not required."
My email sending method is as follows:
public static void SendEmail()
{
var message = new MailMessage()
{
Subject = "Heading",
Body = "Body",
message.From = new MailAddress("test@test.com");
message.To.Add("A valid email address");
}
var smtpClient = new SmtpClient("SMTP-Relay-Server-IP", 25);
smtpClient.Send(message);
}
}
Facts / questions:
- ? IP-
SmtpClient? - , . ( 100% , " " .
- ? ?