Solved

Sending email through smtp server (verifying email validity)

Posted on 2013-10-31
3
356 Views
Last Modified: 2014-11-12
We are sending email from our asp.net application to customers. but sometime we may have wrong email address of customers so it may bounce back.
so while i am sending the mail to the email address...is there a way i can know that the email address is valid

(for instance: to check if agorkhali@gmail.com is an existing email in gmail and another check is to see if agorkhali@somedomain.com is a valid domain name)

...so that we can log it in our database or for record purpose..so that we know that the email did not get sent out for that customer?

also, we would like to track if there is any bounce back of emails.


Attaching a simple test smtp email application just to show what i was trying to do.

and this thread reflect the exact same question i have.
http://social.msdn.microsoft.com/Forums/en-US/8ca20274-eb69-4f58-b735-45deb8e5631f/how-to-calculate-bounced-and-successful-email-in-c?forum=ncl

i am looking at what the alternative would be for this. (exchange server??) ,,


thanks
smtp.txt
0
Comment
Question by:agorkhali
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 40

Expert Comment

by:Kyle Abrahams
ID: 39614997
I'm pretty sure that you can't validate whether or not an email address exists before you send it.  You apparently can verify the domain with this:
http://sourceforge.com/projects/no-cdo  (taken from http://bytes.com/topic/c-sharp/answers/520083-how-process-categorize-bounced-email) . . . which would get you the right side of the "@"

To answer the 2nd part of your question, you can process the bounce backs.  You would set a reply-to in the email, and then a windows service to process the error messages.  Once you got a bounce back email, you could update or flag it so it doesn't go out again until it's modified.

Looking for freeware on how to do that, but no luck as of yet.
0
 

Author Comment

by:agorkhali
ID: 39615111
thanks. Can i send the email through Exchange server instead of smtp relay server?
please let me know if you find the freeware.
0
 
LVL 40

Accepted Solution

by:
Kyle Abrahams earned 500 total points
ID: 39615215
To send via exchange:

From:
http://www.dreamincode.net/forums/topic/257676-sending-an-email-via-an-exchange-server/

using System.Net;  

using System.Net.Mail;  



             MailMessage message = new MailMessage();  

         message.To.Add("myemail");  

         message.Subject = "Test";  

         message.Body = "TESTING";  

         message.From = new MailAddress("myemail");  

         SmtpClient smtp = new SmtpClient("myexchangeserver");  

         smtp.UseDefaultCredentials = false;  // or set to true and skip setting Creds for current user.

         smtp.Credentials = new NetworkCredential("myemail","mypassword");  

         smtp.DeliveryMethod = SmtpDeliveryMethod.Network;  

         smtp.Send(message); 

Open in new window

0

Featured Post

Tutorials alone can't teach real engineering

So we built better training tools.

-Hands-on Labs
-Instructor Mentoring
-Scenario-Based Tests
-Dedicated Cloud Servers

All at your fingertips. What are you waiting for?

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
The new Gmail Phishing Scam going around is surprising even the savviest of users with its sophisticated techniques.
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question