Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Sending mail in ASP.NET

Sending mail in ASP.NET

Scheduled Pinned Locked Moved ASP.NET
csharpasp-netcomquestion
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • W Offline
    W Offline
    Waleed Eissa
    wrote on last edited by
    #1

    From the documentation of the SmtpClient class: If there is an e-mail transmission in progress and you call SendAsync or Send again, you will receive an InvalidOperationException. Does that mean users can't send mail (from different threads) at the same time? Also is there any way to get notified 'programmatically' when the mail is delivered? Thanks

    Waleed Eissa Software Developer Sydney

    C 1 Reply Last reply
    0
    • W Waleed Eissa

      From the documentation of the SmtpClient class: If there is an e-mail transmission in progress and you call SendAsync or Send again, you will receive an InvalidOperationException. Does that mean users can't send mail (from different threads) at the same time? Also is there any way to get notified 'programmatically' when the mail is delivered? Thanks

      Waleed Eissa Software Developer Sydney

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      Waleed Eissa wrote:

      Also is there any way to get notified 'programmatically' when the mail is delivered?

      SendAsyc has an event that fires when it has sent. It's not very reliable, you can't know it was delivered, only that it was sent.

      Christian Graus No longer a Microsoft MVP, but still happy to answer your questions.

      W 1 Reply Last reply
      0
      • C Christian Graus

        Waleed Eissa wrote:

        Also is there any way to get notified 'programmatically' when the mail is delivered?

        SendAsyc has an event that fires when it has sent. It's not very reliable, you can't know it was delivered, only that it was sent.

        Christian Graus No longer a Microsoft MVP, but still happy to answer your questions.

        W Offline
        W Offline
        Waleed Eissa
        wrote on last edited by
        #3

        Thanks a lot for your reply, actually I know about this event but I was hoping there's a more reliable way, basically what I'm trying to do is automate the whole process, this is why I don't want to use DeliveryOptions because I don't want to keep checking my email every now and then to make sure every message was sent, doesn't seem a very reliable way in a production environment. It seems that there's no way to communicate with the SMTP server, I wonder how all those websites with high traffic handle mail issues ..

        Waleed Eissa Software Developer Sydney

        C 1 Reply Last reply
        0
        • W Waleed Eissa

          Thanks a lot for your reply, actually I know about this event but I was hoping there's a more reliable way, basically what I'm trying to do is automate the whole process, this is why I don't want to use DeliveryOptions because I don't want to keep checking my email every now and then to make sure every message was sent, doesn't seem a very reliable way in a production environment. It seems that there's no way to communicate with the SMTP server, I wonder how all those websites with high traffic handle mail issues ..

          Waleed Eissa Software Developer Sydney

          C Offline
          C Offline
          Christian Graus
          wrote on last edited by
          #4

          No, there is literally no way to know if a mail got sent correctly, your best bet is to write a program that checks mail on the return address to see if you get a failure notice, but even that won't really work.

          Christian Graus No longer a Microsoft MVP, but still happy to answer your questions.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups