About
Pricing
Community
Teams
Start Free Trial
Log in
RayT
asked on
1/3/2020
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!!!
Visual Basic.NET
Microsoft Visual Studio
10
1
Last Comment
Chinmay Patel
8/22/2022 - Mon
it_saige
1/3/2020
What are your implementation details?
-saige-
David Favor
1/3/2020
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.
David Favor
1/3/2020
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
https://MailGun.com
or setup your own sending infrastructure.
https://www.experts-exchange.com/questions/29158183/Backloading-emails-into-gmail.html
covers a minimal checklist of how to get started, if you require building a high deliverability, SMTP infrastructure.
Likely best to start with
https://MailGun.com
, then move on to setting up your own infrastructure.
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
Éric Moreau
1/3/2020
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
https://www.emoreau.com/Entries/Articles/2007/09/Using-SystemNetMail.aspx
Chinmay Patel
1/3/2020
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
https://github.com/jstedfa
st/MailKit
per,
https://docs.microsoft.com
/en-us/dot
net/api/sy
stem.net.m
ail.smtpcl
ient?view=
netframewo
rk-4.8
Currently, SmtpClient is supported only to provide platform compatibility and should be avoided, if possible.
https://github.com/dotnet/
platform-c
ompat/blob
/master/do
cs/DE0005.
md
Let me know if you need more information on the same.
Regards,
Chinmay.
RayT
1/3/2020
ASKER
Chinmay,
How do you use MailKit? Is it free?
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
ASKER CERTIFIED SOLUTION
Chinmay Patel
1/3/2020
THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
RayT
1/4/2020
ASKER
Thanks! Microsoft move away from the email business some time ago (
https://docs.microsoft.com/en-us/dotnet/api/system.net.mail.smtpclient?view=netframework-4.8
) 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.
David Favor
1/4/2020
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.
https://www.experts-exchange.com/questions/29158183/Backloading-emails-into-gmail.html
If you expect to have any level of deliverability.
Remember: Sending email is easy. Having email deliver is a monumentally complex task.
Chinmay Patel
1/4/2020
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.
Regards,
Chinmay.
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes
-saige-