Sending e-mail

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Shalini Bhalla
    New Member
    • Dec 2007
    • 190

    Sending e-mail

    can i create an application to send email from vb ?
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    Yes you can do that .

    Comment

    • Shalini Bhalla
      New Member
      • Dec 2007
      • 190

      #3
      van you give me hint sir ? i want to create autoreply email application

      Comment

      • debasisdas
        Recognized Expert Expert
        • Dec 2006
        • 8119

        #4
        Originally posted by Shalini Bhalla
        van you give me hint sir ? i want to create autoreply email application
        Please find a related discussion here .

        Comment

        • jamesd0142
          Contributor
          • Sep 2007
          • 471

          #5
          Here's a working example in vb.net
          [code=vbnet]
          Try

          Dim EMsg As New System.Net.Mail .MailMessage
          EMsg.From = New System.Net.Mail .MailAddress("F romaddress")
          EMsg.To.Add("to address")
          EMsg.Subject = "Test"
          EMsg.Body = "Hello"
          Dim smtp As New System.Net.Mail .SmtpClient("Se rver", port)
          smtp.EnableSsl = True
          If My.User.IsAuthe nticated = True Then
          smtp.UseDefault Credentials = False
          smtp.Credential s = New System.Net.Netw orkCredential(" login", "password")
          End If

          '--------
          Dim att As Attachment
          att = New Attachment(Path & "MRF.zip")
          EMsg.Attachment s.Add(att)
          '----------
          smtp.Send(EMsg)
          'MsgBox("Mail Sent")
          Catch Send_Mail As Exception
          MsgBox(Send_Mai l.ToString)
          End Try
          [/code]

          Comment

          • Shalini Bhalla
            New Member
            • Dec 2007
            • 190

            #6
            I have put MAPI but it starts outlook cinfiguration .........?

            Comment

            • debasisdas
              Recognized Expert Expert
              • Dec 2006
              • 8119

              #7
              Originally posted by Shalini Bhalla
              I have put MAPI but it starts outlook cinfiguration .........?
              outlook must be configured for that .

              The code uses the outlook account to send the mail.

              Comment

              • WinblowsME
                New Member
                • Jan 2008
                • 58

                #8
                Originally posted by Shalini Bhalla
                i want to create autoreply email application
                What exactly are you trying to accomplish with this "autoreply email application?" When and how will this application be used? Do you want this written in VB 6, VBA, or VB.NET? If you're using Outlook, why not use rules?

                Tools -> Rules Wizard

                Comment

                • Shalini Bhalla
                  New Member
                  • Dec 2007
                  • 190

                  #9
                  Can you pls tell me can i set autoresponding in outlook ?

                  Comment

                  • debasisdas
                    Recognized Expert Expert
                    • Dec 2006
                    • 8119

                    #10
                    Originally posted by Shalini Bhalla
                    Can you pls tell me can i set autoresponding in outlook ?
                    Do you have outlook configured on your system ?

                    Comment

                    • jimmylee
                      New Member
                      • Feb 2008
                      • 17

                      #11
                      Private Sub Command1_Click( )
                      Dim email
                      Set email = CreateObject("c do.message")

                      With email
                      .to = "someone@domain .com"
                      .cc = "someone@domain .com"
                      .subject = "something"
                      .From = "someone@domain .com"
                      .textbody = "Some thing"
                      .AddAttachment ("C:\aspsmartup load.dll")
                      .send
                      End With


                      End Sub

                      Comment

                      Working...