Results 1 to 6 of 6

Thread: Send to Email recipient in VB

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2005
    Posts
    2

    Unhappy Send to Email recipient in VB

    Hi, I need to do the same as Windows Explorer Send to....Email recipient command.

    Do you now how?

    For ex. I launch a html file using shell command as follow:

    Shell "rundll32.exe url.dll,FileProtocolHandler file://" & archivo, vbMaximizedFocus

    but I need to do the same to attach a file in new email message....

    Thanks.

  2. #2
    Fanatic Member space_monkey's Avatar
    Join Date
    Apr 2005
    Location
    神と歩くこと
    Posts
    573

    Re: Send to Email recipient in VB

    VB Code:
    1. Option Explicit
    2. Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" _
    3. (ByVal hwnd As Long, _
    4.  ByVal lpOperation As String, _
    5.  ByVal lpFile As String, _
    6.  ByVal lpParameters As String, _
    7.  ByVal lpDirectory As String, _
    8.  ByVal nShowCmd As Long) As Long
    9.  
    10. private sub MyMail()
    11.  
    12. ShellExecute 0, "open", "mailto:" & strMessage, "", "", SW_MINIMIZE
    13.  
    14. end sub

    Where strMessage is your html Message with all the proper html markings for TO:, subject, and body.

    HTH
    Using VB6 or VB.net 2008 with .net 3.5
    "Life... death... either way I'll be confined to a small cubicle!" - Hermes Conrad

  3. #3
    Next Of Kin baja_yu's Avatar
    Join Date
    Aug 2002
    Location
    /dev/root
    Posts
    5,989

    Re: Send to Email recipient in VB

    Also, it would be much easier to open the webpage using ShellExecute. Something like this:

    ShellExecute 0, "open", "http://www.google.com", "", "", SW_MAXIMIZE

  4. #4

    Thread Starter
    New Member
    Join Date
    Aug 2005
    Posts
    2

    Re: Send to Email recipient in VB

    Thanks, but what's up with the attachment?

  5. #5
    Next Of Kin baja_yu's Avatar
    Join Date
    Aug 2002
    Location
    /dev/root
    Posts
    5,989

    Re: Send to Email recipient in VB

    You mean how to include it automatically uppon shelling?

  6. #6
    Addicted Member
    Join Date
    Aug 2002
    Location
    Alberta, Canada
    Posts
    138

    Re: Send to Email recipient in VB

    This worked for me when I was trying to send email in vb

    CLick Here
    Jon_G
    AKA Phil From Marketing
    **************************************
    Insert Something Memorable And Witty Here.
    **************************************

Posting Permissions

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



Click Here to Expand Forum to Full Width