Sending Emails

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nawaray
    New Member
    • Feb 2008
    • 5

    Sending Emails

    HI....


    i have visual basic 6 and i want this program to send me emails.. i don't have any idea how to do this...
    can someone explain for me step by step how to do this....



    thank you
  • nawaray
    New Member
    • Feb 2008
    • 5

    #2
    no reply:(

    please i need someones help

    Comment

    • debasisdas
      Recognized Expert Expert
      • Dec 2006
      • 8119

      #3
      Try to use Microsoft MAPI controls..

      Comment

      • nawaray
        New Member
        • Feb 2008
        • 5

        #4
        how can i use that? can you explain for me please

        Comment

        • debasisdas
          Recognized Expert Expert
          • Dec 2006
          • 8119

          #5
          add mapisession and mapimessage control to the form.

          try to use the sample

          [code=vb]
          Private Sub Command1_Click( )
          MAPISession1.Si gnOn
          MAPIMessages1.S essionID = MAPISession1.Se ssionID
          'Compose new message
          MAPIMessages1.C ompose
          'Address message
          MAPIMessages1.R ecipDisplayName = "debasis"
          MAPIMessages1.R ecipAddress = "debasis.8000@g mail.com"
          ' Resolve recipient name
          MAPIMessages1.A ddressResolveUI = True
          MAPIMessages1.R esolveName
          'Create the message
          MAPIMessages1.M sgSubject = "Hi"
          MAPIMessages1.M sgNoteText = "Test mail"
          'Add an attachment
          MAPIMessages1.A ttachmentPathNa me = "path of the file to attach"
          'Send the message
          MAPIMessages1.S end False
          MAPISession1.Si gnOff
          End Sub


          [/code]

          Comment

          • jimmylee
            New Member
            • Feb 2008
            • 17

            #6
            [code=vb]
            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[/code]
            Last edited by debasisdas; Feb 11 '08, 09:53 AM. Reason: added code=vb tags

            Comment

            • nawaray
              New Member
              • Feb 2008
              • 5

              #7
              where shall i insert this code?
              in the form? or a button?

              Comment

              • debasisdas
                Recognized Expert Expert
                • Dec 2006
                • 8119

                #8
                The code itself is self explanatory.

                Comment

                • jamesd0142
                  Contributor
                  • Sep 2007
                  • 471

                  #9
                  Originally posted by nawaray
                  where shall i insert this code?
                  in the form? or a button?
                  insert the code in a button

                  Comment

                  Working...