|
-
Apr 5th, 2006, 07:29 PM
#1
Thread Starter
Hyperactive Member
Mail from VB6 without MAPI
There are many ways to sent email from VB, and while it is quite possible to do it with the MAPI control, i found a much simpler way, using a webbrowser control and an ASP page. My code simply retrieves the to, from, subject and body information from the url. To use it, you just create an invisble web browser in the form, and then with a little string manipulation, you can navigate to the webbrowser with all the info necessary to send the email.
The page is on my site at www.startingqbasic.co.uk/aspmailer.asp.
To use it, add values for to=,from=,subject= and body= values to the url and there you go. I use this vb code:
VB Code:
Private Sub sendmailbutton_Click()
Dim mailurl As String
mailurl = "http://www.startingqbasic.co.uk/aspmailer.asp?"
' that line sets the start of the page string
mailurl = mailurl + "to=" + to_box.Text
'this adds the to details to the navigation string
mailurl = mailurl + "&" + "from=" + from_box.Text
'this adds the from details to the navigation string
mailurl = mailurl + "&" + "subject=" + subject_box.Text
'this adds the subject details to the navigation string
mailurl = mailurl + "&" + "body=" + body_box.Text
'this adds the subject details to the navigation string
mailbrowser.Navigate (mailurl)
'this navigates the webbrowser to the page
End Sub
And thats it. It's free, and if you would like the asp code for it, just email and ask.
KAZAR
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|