Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

MetroidHunter

Using OutLook with VB.NET

This topic is 5654 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I''m trying to add a feature to my application so that when the user clicks a button, it allows them to type an email up in a seperate form, and then send it using Outlook, passing in values from textboxes. So far, I''ve been able to get it to send the email address to outlook using the commands:
Dim link As String = "mailto://" & emailDir.GetCurrentRow("strEmail")

Try
            Process.Start("OutLook.exe", link)
...
Is there any way to accomplish this?

Share this post


Link to post
Share on other sites
Advertisement
What about of using the outlook object model to start outlook and get some REAL control over it?

Share this post


Link to post
Share on other sites
Right now, I have a rich textbox where the body of the email is entered, and I have added checkboxes to make the text bold, italicized, and/or underlined, which work correctly when I type the email body in the form. When I go to send the email, the formatting I do is lost and the result is just plain text. I can't determine whether or not this is a coding problem, or if it's something I need to set on outlook. My code for sending the email is:

Dim oLapp As Object
Dim oItem As Object
Try
oLapp = CreateObject("Outlook.application")
oItem = oLapp.CreateItem(0)
With oItem
.Subject = txtSubject.Text
.To = txtSendTo.Text
.Body = rtbMessage.Text
.Send()
End With
MsgBox("Email sent!", MsgBoxStyle.Information, emailDir.GetAppName)
Catch f As Exception
MsgBox("Email could not be sent." & CrLf & "Make sure Outlook is configured properly.", MsgBoxStyle.Information, emailDir.GetAppName)
Finally
oLapp = Nothing
oItem = Nothing
Me.Close()
End Try



[edited by - MetroidHunter on June 19, 2003 1:31:17 PM]

Share this post


Link to post
Share on other sites
Outlook(and any other decent mail client) is usually set to wrap text at ~76 characters.



AnkhSVN - A Visual Studio .NET Addin for the Subversion version control system.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!