Y
Y
Ytsu Ytsuevich2015-08-09 22:59:05
ASP.NET
Ytsu Ytsuevich, 2015-08-09 22:59:05

How to send mail through ASP.NET?

How can I find out if my hosting has a mail server?
If that hosting: https://somee.com tariff is free!
0da27d3a910a4f4b816d52b97b698895.PNGIs it cheers?
How to use it?
I'm expecting a PHP-like solution with one function: email(to, subject, body);

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2015-08-10
@Mixxer

var smtpClient = new SmtpClient();
var fromAddress = new MailAddress("[email protected]"); 
var toAddress = new MailAddress("[email protected]"); 
var mail = new MailMessage(fromAddress, toAddress)
        {
                IsBodyHtml = true,
                Subject = "TestTest"
        };
var htmlView = AlternateView.CreateAlternateViewFromString("html-код письма", Encoding.UTF8, "text/html");
mail.AlternateViews.Add(htmlView);
smtpClient.EnableSsl = false;
smtpClient.Send(mail);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question