Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Generating automatic mail (URGENT)
Message
 
To
22/09/2002 01:54:17
General information
Forum:
Visual Basic
Category:
Other
Miscellaneous
Thread ID:
00702657
Message ID:
00703158
Views:
15
The best method I found to send e-mails using any clients is to use SMTP e-mails and the link I gave you just do that. vbSendMail allows you to send attachments, HTML formatted e-mails, ...

The thing is that each e-mail client differs in the way they are sending mails and not all e-mail clients can be used by automation.

Another that is much more restrictive (and doesn't always work is to use the MailTo protocol. See this code:
Public Sub SendMail(ByVal plngHwnd As Long)
Dim strAddedText As String
Dim strText As String

    If Len(Trim$(AddressTo)) > 0 Then
        strText = AddressTo
    End If

    If Len(Trim$(AddressCC)) > 0 Then
        strAddedText = strAddedText & "&CC=" & AddressCC
    End If

    If Len(Trim$(AddressBCC)) > 0 Then
        strAddedText = strAddedText & "&BCC=" & AddressBCC
    End If

    If Len(Trim$(Subject)) > 0 Then
        strAddedText = strAddedText & "&Subject=" & Subject
    End If

    If Len(Trim$(Body)) > 0 Then
        strAddedText = strAddedText & "&Body=" & Body
    End If

    If Len(Trim$(Attachments)) > 0 Then
        strAddedText = strAddedText & "&Attachment=" & Chr(34) & Attachments & Chr(34)
    End If

    strText = "mailto:" & strText

    ' clean the added elements
    If Len(strAddedText) > 0 Then
        ' there are added elements, replace the first
        ' ampersand with the question character
         Mid$(strAddedText, 1, 1) = "?"
    End If

    strText = strText & strAddedText
    If Len(strText) Then
        Call ShellExecute(plngHwnd, "open", strText, vbNullString, vbNullString, 1)
    End If
End Sub
>Hi Eric,
>
>thanx for u r ans, but i want to send a autogenerated mail using my default mail programme like Edora or OutLook etc.
>so pls tell me how should i do that????
>
>
>Amol
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com
Previous
Reply
Map
View

Click here to load this message in the networking platform