Send email with notification-VBForums
Results 1 to 3 of 3

Thread: Send email with notification

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2004
    Posts
    358

    Send email with notification

    Hi,

    VB.NET:2005

    I try to send an email and receive a SUCCESS notification.
    I read a lot of post using google, but can't find my answer.

    This is my code:
    Code:
    Dim mmMail As New System.Net.Mail.MailMessage
    Dim smtpClient As New System.Net.Mail.SmtpClient
    
    With mmMail
        .IsBodyHtml = True
        .From = New System.Net.Mail.MailAddress("myemailhere")
        .To.Add(New System.Net.Mail.MailAddress("myemailhere"))
        .Subject = "Test subject"
        .Body = "Test body"
    
        .DeliveryNotificationOptions = Net.Mail.DeliveryNotificationOptions.OnSuccess
    
    End With
    
    With smtpClient
        .Host = "myhostaddresshere"
        .Port = 25
        .Send(mmMail)
    End With

    This never sends me a success email. Why?
    If I change "OnSuccess" to "OnFailure" and I enter a wrong email address in the ".To..." is works, I received the failure notification.

    I just need to make it work for the Success notification. Also, is it possible to receive OnFailure notification aswell as OnSuccess?


    Thank you for your help.

  2. #2
    Lively Member
    Join Date
    Jul 2008
    Posts
    89

    Re: Send email with notification

    is the email being delivered successfully, but you just don't receive a notification that it was successful or is the email not being delivered at all?

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2004
    Posts
    358

    Re: Send email with notification

    The email is received successfully.

    I use 2 of my own email addresses, so I know for sure the reception was a success.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.