Skip to content

Mail from .aspx page

Sudarshan Nandakumar

Asked Aug 1, 2013, 2:19 AM EDT5 answers
Share
LinkedInX
Hi All,

We need to get mail id invalid message in a .aspx page and the corresponding notification mail must be send to provided mail id(the notification mail must provide the details for the failure and timestamp).

For the above mentioned purpose is it mandatory to get SMTP protcol access from server side?

We need to get the failure message..........

5 Answers

Know the answer? Post it. Somebody with the same question will find it here.

  • Sunny  Sharma
    0
    Hi Sudarshan,

    It always requires a SMTP server to send an email anywhere. Obviously you also will need to have one. you can menion anything in the body of email message be it Success/Failure/Information etc.
    0
  • 0
    Hi,

    Thanks for your response.We are having a server which host the webpages ie .aspx page,but on the other hand is it necessary to get the access from server side???

    Few more queries:

    1.Is it possible to capture that message and re-route our application support mailbox?
    2.Is there any issues realted to domain ie.our application we can check what about gmail,yahoo or hotmail and all?

    Can you please clarify on that part also?
    0
  • Sunny  Sharma
    0
    Of course. For your first question, you always have options to use your own Email Server if you have one implemented in your organization. The answer to your first question relates to the second.

    You're free to use any third party Email Service Provider to send email on your behalf. You can also use Gmail, Yahoo, Hotmail, AOL etc. I'm adding a sample code of how you could do this using Gmail SMTP Server. I hope you find it helpful:
    -------------------------------------
                SmtpClient EmailClient = new SmtpClient("smtp.gmail.com", 587);
    VB.NET
                EmailClient.Credentials = new NetworkCredential("[email protected]", "MyGmailPassword");
                EmailClient.EnableSsl = true;
                System.Net.Mail.MailMessage msg = new System.Net.Mail.MailMessage();
                msg.Body = messageBody;
                msg.IsBodyHtml = true;
                msg.Subject = "Test Subject";
                msg.From = new MailAddress("[email protected]", "Sunny Kumar");
                msg.To.Add("[email protected]");
                EmailClient.Send(msg);
    ---------------------------------------
    
    Happy Coding :)
    0
  • 0
    Thanks sunny....i will try to do it and my question regarding getting that message to our application mail box is it possible???

    Let me give a illustration for your understanding:

    Like a user is not using his\her email for long time and it got expired.Then,we are having a query which needs user answers  and we are sending that query to the user's registered mail id(it is not valid right now).

    The application will send a success delivered messages to our application support mail box.....if its not delivered(we need to have a message it not valid mail id for so and so reasons.kindly check the id)..........

    I will to re-route that failure error message to my support mail box?
    0
  • Sunny  Sharma
    0
    See, if you're using third party SMTP Server to send emails (any kind of) and if it gets failed/bounced/etc. it depends on that provider if it sends any kind of acknowledgement back to the sender. Like if you send an email from Gmail to an invalid email id, it sends you back an acknowledgement that it couldn't reach that mailbox or it's an invalid email id(if you provided a gmail id). 

    To answer your second part of the question, believe me, there's no robust tool or way to know if the email id exists or not. You could only know if you get a response from that email id.


    Hope you got the point. 
    0