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. Mail is not reached

Mail is not reached

Scheduled Pinned Locked Moved ASP.NET
csharpasp-netcomtutorialquestion
3 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.
  • K Offline
    K Offline
    Kissy16
    wrote on last edited by
    #1

    Hi all, Am trying to send an email from my asp.net page. Am using 5 textboxes and a button. Following is my code , After clicking the submit button it is displaying that mail sent successfully. How to ensure that mail has been reached.In my gmai maibox no msg was there. Can anybody tell me.?? Submit Button click event Dim tc, cc, bcc, subject, body As String tc = _txtTo.Text cc = _txtFrom.Text bcc = _txtBCC.Text subject = _txtSubject.Text body = _txtMessage.Text Dim status As Integer = sendMail(tc, cc, bcc, subject, body) If (status = 1) Then Response.Write("your mail has been sent successfully") Else Response.Write("sorry! your mail could not be sent�") End If My sendMail fuction Private Function sendMail(ByVal tc As String, ByVal cc As String, ByVal ccc As String, ByVal subject As String, ByVal body As String) As Integer Try SmtpMail.SmtpServer = "localhost" Dim msg As MailMessage = New MailMessage msg.From = "mymail@gmail.com" msg.Cc = cc msg.Bcc = ccc msg.Subject = subject msg.Body = body SmtpMail.Send(msg) Return 1 Catch ex As Exception Return 0 End Try End Function

    kissy

    S 1 Reply Last reply
    0
    • K Kissy16

      Hi all, Am trying to send an email from my asp.net page. Am using 5 textboxes and a button. Following is my code , After clicking the submit button it is displaying that mail sent successfully. How to ensure that mail has been reached.In my gmai maibox no msg was there. Can anybody tell me.?? Submit Button click event Dim tc, cc, bcc, subject, body As String tc = _txtTo.Text cc = _txtFrom.Text bcc = _txtBCC.Text subject = _txtSubject.Text body = _txtMessage.Text Dim status As Integer = sendMail(tc, cc, bcc, subject, body) If (status = 1) Then Response.Write("your mail has been sent successfully") Else Response.Write("sorry! your mail could not be sent�") End If My sendMail fuction Private Function sendMail(ByVal tc As String, ByVal cc As String, ByVal ccc As String, ByVal subject As String, ByVal body As String) As Integer Try SmtpMail.SmtpServer = "localhost" Dim msg As MailMessage = New MailMessage msg.From = "mymail@gmail.com" msg.Cc = cc msg.Bcc = ccc msg.Subject = subject msg.Body = body SmtpMail.Send(msg) Return 1 Catch ex As Exception Return 0 End Try End Function

      kissy

      S Offline
      S Offline
      SeMartens
      wrote on last edited by
      #2

      Hi, calling SmtpMail.Send just passes the message to your smtp-server (localhost in your case). This doesn't say anything about if the mail was "physically" send to gmail. You have to check if your smtp-server has trouble sending the mail to gmail. Have a look in the queues of your smtp-server (can be found under inetpub). Then check for errors in the event log. It could also be that gmail doesn't allow that messages are sent to them by your smtp-server (for security reasons). Let me know if you need some further help. Regards Sebastian

      It's not a bug, it's a feature! Check out my CodeProject article Permission-by-aspect. Me in Softwareland.

      K 1 Reply Last reply
      0
      • S SeMartens

        Hi, calling SmtpMail.Send just passes the message to your smtp-server (localhost in your case). This doesn't say anything about if the mail was "physically" send to gmail. You have to check if your smtp-server has trouble sending the mail to gmail. Have a look in the queues of your smtp-server (can be found under inetpub). Then check for errors in the event log. It could also be that gmail doesn't allow that messages are sent to them by your smtp-server (for security reasons). Let me know if you need some further help. Regards Sebastian

        It's not a bug, it's a feature! Check out my CodeProject article Permission-by-aspect. Me in Softwareland.

        K Offline
        K Offline
        Kissy16
        wrote on last edited by
        #3

        Thanks for ur prompt reply. Ya under inetpur,my mail messages were with msg icon. then form here what i have to do,so that i can send mail to any mail account of the user? Please dont feel trouble let me know how can i send msgs from my asp.net page. please....

        kissy

        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