Link to home
Start Free TrialLog in
Avatar of RayT
RayTFlag for United States of America

asked on

Sending email using SMTP

How do you send an email using SMTP, Visual Basic and Visual Studio 2019?  I can't get it to work!!!
Avatar of it_saige
Flag of United States of America image

What are your implementation details?

Sending is fairly straight forward. Normally you'll use an SMTP library for this, rather than writing your own SMTP code.

As it_saige mentioned, we'll have to see your code to provide assistance.
Aside: There's a big difference between sending email + having email delivery.

You can't just setup SMTP, send an email, imagine it will every arrive at a recipient.

For high deliverability email, you'll use a relay service like or setup your own sending infrastructure. covers a minimal checklist of how to get started, if you require building a high deliverability, SMTP infrastructure.

Likely best to start with, then move on to setting up your own infrastructure.
What have you tried? System.Net.Mail?

Your issues might come from your relay. You need to use one (Gmail, O365, ...). What are you using?

Have a look at
Hi Ray,

As other experts have suggested, without looking at your code it is next to impossible to guess what is the real culprit.
Also, just so you know, Microsoft's current recommendation is to use library like MailKit

Currently, SmtpClient is supported only to provide platform compatibility and should be avoided, if possible.

Let me know if you need more information on the same.

Avatar of RayT



How do you use MailKit?  Is it free?
Avatar of Chinmay Patel
Chinmay Patel
Flag of India image

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of RayT


Thanks!  Microsoft move away from the email business some time ago ( and it's been costly to find solutions.  I'm currently paying an annual fee for a solution and I was curious to find a free solution.
If you opt for using MailKit or any other MTA-esque code which sends email from IPs you own, you must still go through all the IP setup checklist items for every sending IP you use.

If you expect to have any level of deliverability.

Remember: Sending email is easy. Having email deliver is a monumentally complex task.
Hi Ray,

With advent of .Net Core, I think almost all products will have a free, open source, community driven (But Microsoft backed/overwatched) alternative.

Let me know if there are other similar challenges you are facing, I might be able to drop in some pointers.