Do you use Web Service to send emails?

Updated by Igor Goldobin 1 year ago. See history

123
No component provided for introEmbed
SmtpClient client = new SmtpClient();
try
{
client.Host = "****.***.com.au";
client.Port = 25;
client.UseDefaultCredentials = true;
MailAddress from = new MailAddress("test@ssw.com.au");
string unrecAddy = "test@ssw.com.au";
MailAddress to = new MailAddress(unrecAddy);
MailMessage mailMessage = new MailMessage(from, to);
mailMessage.Subject = "aaa";
string strVer = "aaa";
mailMessage.Body = "aaa";
client.Send(mailMessage);
}
catch(Exception ex)
{
client.SendAsyncCancel();
MessageBox.Show(ex.ToString());
}

❌ Figure: Bad example - Send mail without webservice

Emailer.PubicFunction pf = new EmailWebServices.Emailer.Publiction();
pf.SendMail("Test", textBox3.Text, textBox1.Text, textBox2.Text, false, "", null);

✅ Figure: Good example - Send mail use webservice

Acknowledgements

Adam Cogan
Related rules

Need help?

SSW Consulting has over 30 years of experience developing awesome software solutions.

We open source.Loving SSW Rules? Star us on GitHub. Star