Do we need IIS for sending mails from an Vb.Net applications

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dskinibbyb
    New Member
    • Mar 2007
    • 8

    Do we need IIS for sending mails from an Vb.Net applications

    Hi to every one,
    I am having a problem while sending mail from my application. iI want to send mail from my Vb.Net applications. and it is working fine in my system, but the problem is that when i try to run tha same application from another system where there is no iis installed, its giving me error mail not sent, and when i change the DeliveryMethod to network , giving me tha same problem...
    So can anyone help me out with this problem..
    The code is as below.
    Public pInPassword As String
    Public pOutMailId As String
    Private Sub btnSend_Click(B yVal sender As System.Object, ByVal e As System.EventArg s) Handles btnSend.Click
    Try
    'err msg = Request for the permission of type 'System.net.mai l.smtpPermissio n, system, Version=2.0.0.0 , Culture=neutral , PublicKey token= b77a5c561934e08 9' failed
    Dim msg As System.Net.Mail .MailMessage
    Dim objSmtp As New System.Net.Mail .SmtpClient("65 .175.81.34")
    msg = New System.Net.Mail .MailMessage(tx tFrom.Text, txtTo.Text, txtSub.Text, txtBody.Text)
    msg.IsBodyHtml = True
    If check() = True Then
    objSmtp.Credent ials = New System.Net.Netw orkCredential(t xtFrom.Text, txtPassword.Tex t, "65.175.81. 34")
    objSmtp.Deliver yMethod = SmtpDeliveryMet hod.SmtpDeliver yMethod.Network
    objSmtp.Send(ms g)
    MessageBox.Show ("Mail Sent Successfully... .")
    ClearForm()
    End If

    Catch ex As Exception
    MessageBox.Show (ex.Message)
    End Try


    Thank you in advance.
    Deepak
    Last edited by dskinibbyb; May 16 '07, 06:43 AM. Reason: Change in query
  • dip_developer
    Recognized Expert Contributor
    • Aug 2006
    • 648

    #2
    Originally posted by dskinibbyb
    Hi to every one,
    I am having a problem while sending mail from my application. iI want to send mail from my Vb.Net applications. and it is working fine in my system, but the problem is that when i try to run tha same application from another system where there is no iis installed, its giving me error mail not sent, and when i change the DeliveryMethod to network , giving me tha same problem...
    So can anyone help me out with this problem..
    The code is as below.
    Public pInPassword As String
    Public pOutMailId As String
    Private Sub btnSend_Click(B yVal sender As System.Object, ByVal e As System.EventArg s) Handles btnSend.Click
    Try
    'err msg = Request for the permission of type 'System.net.mai l.smtpPermissio n, system, Version=2.0.0.0 , Culture=neutral , PublicKey token= b77a5c561934e08 9' failed
    Dim msg As System.Net.Mail .MailMessage
    Dim objSmtp As New System.Net.Mail .SmtpClient("65 .175.81.34")
    msg = New System.Net.Mail .MailMessage(tx tFrom.Text, txtTo.Text, txtSub.Text, txtBody.Text)
    msg.IsBodyHtml = True
    If check() = True Then
    objSmtp.Credent ials = New System.Net.Netw orkCredential(t xtFrom.Text, txtPassword.Tex t, "65.175.81. 34")
    objSmtp.Deliver yMethod = SmtpDeliveryMet hod.SmtpDeliver yMethod.Network
    objSmtp.Send(ms g)
    MessageBox.Show ("Mail Sent Successfully... .")
    ClearForm()
    End If

    Catch ex As Exception
    MessageBox.Show (ex.Message)
    End Try


    Thank you in advance.
    Deepak
    check Whether SMTP mail server is configured on that particular machine or not...

    Comment

    • dskinibbyb
      New Member
      • Mar 2007
      • 8

      #3
      Originally posted by dip_developer
      check Whether SMTP mail server is configured on that particular machine or not...
      Hi dip_developer,
      I asked my system Admin, and he said that smtp server is configured in server itself and he has given my the same Ip address of the smtp server so no need to configure the server..
      Can you tell me what else i have to check?
      this problem is really making me crazy.
      thanks.

      Comment

      • dip_developer
        Recognized Expert Contributor
        • Aug 2006
        • 648

        #4
        Look at this

        SMTP Server Set up

        Comment

        • dskinibbyb
          New Member
          • Mar 2007
          • 8

          #5
          Originally posted by dip_developer
          Look at this

          SMTP Server Set up
          SO without IIS i wont be able to send mail's isnt it?.
          il try to install IIs and check my application.
          Then all clients using this windows application must have IIS?
          Thanks

          Comment

          • dskinibbyb
            New Member
            • Mar 2007
            • 8

            #6
            Originally posted by dskinibbyb
            SO without IIS i wont be able to send mail's isnt it?.
            il try to install IIs and check my application.
            Then all clients using this windows application must have IIS?
            Thanks
            hi dip_developer
            My problem got solved....
            Actually that machine dint had default gateway... and when i configured the gateway its working now...
            Thanks...

            Comment

            Working...