|
-
Jun 23rd, 2006, 03:09 PM
#1
Thread Starter
Lively Member
Send Email With Outlook
Hi Can Some Tell Me The Code That Opens Outlook Express To Send A Message And Adds The Email You Want To Send It To .
Thanks
-
Jun 23rd, 2006, 04:49 PM
#2
Re: Send Email With Outlook
Try this
VB Code:
'strEmailRequestor is the person sending the email
'strEmailSubject is the subject
'strEmailBody is the text of the email
Public Sub generate_email()
Dim objOutlook As Object
Dim mailRequestor As Object
On Error GoTo GenerateError
Set objOutlook = CreateObject("Outlook.Application", "localhost")
Set mailRequester = objOutlook.CreateItem(olMailItem)
mailRequester.To = strEmailRequester
mailRequester.Subject = strEmailSubject
mailRequester.Body = strEmailBody
mailRequester.Send
Exit Sub
GenerateError:
'handle your errors here
End Sub
although it triggers Outlook's security "feature", so it's better to not use Outlook to send mail.
The most difficult part of developing a program is understanding the problem.
The second most difficult part is deciding how you're going to solve the problem.
Actually writing the program (translating your solution into some computer language) is the easiest part.
Please indent your code and use [HIGHLIGHT="VB"] [/HIGHLIGHT] tags around it to make it easier to read.
Please Help Us To Save Ana
-
Jun 23rd, 2006, 08:35 PM
#3
Hyperactive Member
Re: Send Email With Outlook
Why don't you just search google. I know there is a thing that will let you do this. My suggestion is having a Process and using an html code.
Something like this
VB Code:
Process.start("mailto: whomever")
Then just search online for the mailto thing on how to add a richtextbox's text in there and you are set.
"Imagination is more important than knowledge" - Albert Einstein, born on March 14th 1879.
Can't find it here on VBForums? Go to the CodeProject. MSDN is your friend . I have such a bad website, my friend decided it would be funny to change the template and he moderates the site for me: visit my site!
"Thinking of you, wherever you are
We pray for our sorrows to end, and hope that our hearts will blend.
Now I will step forward to realize this wish.
And who knows, starting a new journey may not be so hard…
Or maybe it has already begun.
There are many worlds, but they share the same sky
one sky, one destiny..."
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
|