|
-
Dec 13th, 2007, 07:36 PM
#1
Thread Starter
Addicted Member
Outlook voting buttons - MailMessage class
Hi,
Does anyone know if it's possible to add a custom header to the MailMessage class in vb.net for voting buttons?
I was able to add a custom header for "Reply-to", and send the email, but I need to know if it's possible for vb.net.
Should I be using other classes or components for this?
Here is sample code....
code Code:
Imports System.Web.Mail
Module Module1
Sub Main()
Dim message As New MailMessage
message.Subject = "test"
message.Body = "test"
message.Headers.Add("?", "?") 'what goes here?
Dim email As SmtpMail
email.SmtpServer = "mail.bubba.com"
email.Send(message)
End Sub
End Module
-
Dec 14th, 2007, 03:49 PM
#2
Thread Starter
Addicted Member
Re: Outlook voting buttons - MailMessage class
Well, I got close, but then I could not find a way to convert an outlook.mailitem into a mailmessage item, so I can try to change the "from"
Here is how you do it in vb.net using redemption tool to avoid the outlook security thingy...
vb Code:
Imports Microsoft.Office.Interop
Imports System.Web.Mail
Module Module1
Sub Main()
Dim olApp As Outlook.Application
olApp = CreateObject("Outlook.Application")
Dim safeItem As New Redemption.SafeMailItem
Dim olItem As Outlook.MailItem
olItem = olApp.CreateItem(Outlook.OlItemType.olMailItem)
With olItem
.Subject = "vote test"
.Body = "test message"
.VotingOptions = "Yes;No"
End With
safeItem.Item = olItem
safeItem.Send()
olItem = Nothing
olApp = Nothing
End Sub
-
Dec 14th, 2007, 03:51 PM
#3
Thread Starter
Addicted Member
Re: Outlook voting buttons - MailMessage class
The only problem with this code is that you need to have an Outlook profile on the machine that is sending the email, and you cannot change the "from" address. :-(
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
|