A
Andrew Robinson
I used to use CDO to send HTML embedded emails (including images). I can't
seem to get this working using COM Interop. System.Web.Main doesn't seem
allow for embedded graphics. Any ideas? I would really like to role my own
rather than purchasing a 3rd party library.
Tageting a windows forms application in c#. Have attached the old VB6 code
as an example.
thanks,
Private Sub sendMessage(messageTo As String, messageFrom As String,
messageSubject As String, messageBody As String, errorInfo As String,
ClientID As Long)
Dim iMsg As New cdo.Message
Dim iConf As New cdo.Configuration
Dim Flds As ADODB.Fields
Set Flds = iConf.Fields
Flds(cdoSendUsingMethod) = cdoSendUsingPort
Flds(cdoSMTPServer) = "localhost"
Flds(cdoSMTPServerPort) = 25
Flds(cdoSMTPConnectionTimeout) = 30
Flds(cdoSendUserReplyEmailAddress) = txtFrom
Flds(cdoSendEmailAddress) = txtFrom
Flds.Update
Set iMsg.Configuration = iConf
iMsg.To = messageTo
iMsg.subject = messageSubject
iMsg.AutoGenerateTextBody = True
iMsg.TextBody = messageBody
iMsg.CreateMHTMLBody txtHTMLurl, cdoSuppressNone
iMsg.Send
seem to get this working using COM Interop. System.Web.Main doesn't seem
allow for embedded graphics. Any ideas? I would really like to role my own
rather than purchasing a 3rd party library.
Tageting a windows forms application in c#. Have attached the old VB6 code
as an example.
thanks,
Private Sub sendMessage(messageTo As String, messageFrom As String,
messageSubject As String, messageBody As String, errorInfo As String,
ClientID As Long)
Dim iMsg As New cdo.Message
Dim iConf As New cdo.Configuration
Dim Flds As ADODB.Fields
Set Flds = iConf.Fields
Flds(cdoSendUsingMethod) = cdoSendUsingPort
Flds(cdoSMTPServer) = "localhost"
Flds(cdoSMTPServerPort) = 25
Flds(cdoSMTPConnectionTimeout) = 30
Flds(cdoSendUserReplyEmailAddress) = txtFrom
Flds(cdoSendEmailAddress) = txtFrom
Flds.Update
Set iMsg.Configuration = iConf
iMsg.To = messageTo
iMsg.subject = messageSubject
iMsg.AutoGenerateTextBody = True
iMsg.TextBody = messageBody
iMsg.CreateMHTMLBody txtHTMLurl, cdoSuppressNone
iMsg.Send