G
Guest
I have created a .Net Service that is sending mails using SMTP Server/Exchange Server how do i put in a Digital Signature so the reciver is 100% sure that the mail i from the owner of Server where the Service is running ?
It should worke something lige Outlook does it you type in your secret password and Outlook together with the code create a Mail with digital signature
Thank
Ki
If I have to use another way of sending mails to use Digital Signature, please tell me so
To send the mail I use this code
Public Sub Send_Mail(ByVal m_AttachmentPath As String, ByVal m_TextBody As String, ByVal m_From As String,
ByVal m_SendTo As String, ByVal m_TrackID As String, ByVal m_Database As String, ByVal m_Subject As String,
Optional ByVal m_MDNRequested As String = "", Optional ByVal m_HTMLBody As String = ""
Dim cnn As ADODB.Connectio
Dim strUrl As Strin
Dim rec As ADODB.Recor
Tr
Dim MsgConfig As CDO.Configuration = New CDO.Configuratio
Dim MailMessage As CDO.Message = New CDO.Messag
Dim oFlds As ADODB.Field
oFlds = MailMessage.Field
oFlds.Item("urn:shemas:mailheader:test").Value = "Test
oFlds.Update(
MsgConfig.Fields("SendUsing").Value = 3 'CDO.CdoSendUsing.cdoSendUsingExchang
MsgConfig.Fields.Update(
MailMessage.Configuration = MsgConfi
MailMessage.Fields.Append("urn:schemas:mailheader:MyMailHeader", ADODB.DataTypeEnum.adBSTR, , , "1"
MailMessage.Fields.Append("evision", ADODB.DataTypeEnum.adBSTR, , , Verify_Guid.ToString
MailMessage.Fields.Append("trackid", ADODB.DataTypeEnum.adBSTR, , , "1"
MailMessage.Fields.Append("replyadr", ADODB.DataTypeEnum.adBSTR, , , m_From
MailMessage.MDNRequested = m_MDNRequeste
MailMessage.To = m_SendT
MailMessage.Subject = Verify_Guid + ";" + m_TrackID.ToString + ";" + m_From + ";" + m_Database + ";" + m_Subjec
MailMessage.From = m_Fro
If m_TextBody <> "" The
MailMessage.TextBody = m_TextBod
Els
MailMessage.HTMLBody = m_HTMLBod
End I
MailMessage.AddAttachment(m_AttachmentPath
MailMessage.Fields.Update(
MailMessage.Send(
MailMessage = Nothin
Catch e As System.SystemExceptio
EventLog.WriteEntry("Error", "Mail is not send, error: " & e.Message, System.Diagnostics.EventLogEntryType.Error, 1
End Try
It should worke something lige Outlook does it you type in your secret password and Outlook together with the code create a Mail with digital signature
Thank
Ki
If I have to use another way of sending mails to use Digital Signature, please tell me so
To send the mail I use this code
Public Sub Send_Mail(ByVal m_AttachmentPath As String, ByVal m_TextBody As String, ByVal m_From As String,
ByVal m_SendTo As String, ByVal m_TrackID As String, ByVal m_Database As String, ByVal m_Subject As String,
Optional ByVal m_MDNRequested As String = "", Optional ByVal m_HTMLBody As String = ""
Dim cnn As ADODB.Connectio
Dim strUrl As Strin
Dim rec As ADODB.Recor
Tr
Dim MsgConfig As CDO.Configuration = New CDO.Configuratio
Dim MailMessage As CDO.Message = New CDO.Messag
Dim oFlds As ADODB.Field
oFlds = MailMessage.Field
oFlds.Item("urn:shemas:mailheader:test").Value = "Test
oFlds.Update(
MsgConfig.Fields("SendUsing").Value = 3 'CDO.CdoSendUsing.cdoSendUsingExchang
MsgConfig.Fields.Update(
MailMessage.Configuration = MsgConfi
MailMessage.Fields.Append("urn:schemas:mailheader:MyMailHeader", ADODB.DataTypeEnum.adBSTR, , , "1"
MailMessage.Fields.Append("evision", ADODB.DataTypeEnum.adBSTR, , , Verify_Guid.ToString
MailMessage.Fields.Append("trackid", ADODB.DataTypeEnum.adBSTR, , , "1"
MailMessage.Fields.Append("replyadr", ADODB.DataTypeEnum.adBSTR, , , m_From
MailMessage.MDNRequested = m_MDNRequeste
MailMessage.To = m_SendT
MailMessage.Subject = Verify_Guid + ";" + m_TrackID.ToString + ";" + m_From + ";" + m_Database + ";" + m_Subjec
MailMessage.From = m_Fro
If m_TextBody <> "" The
MailMessage.TextBody = m_TextBod
Els
MailMessage.HTMLBody = m_HTMLBod
End I
MailMessage.AddAttachment(m_AttachmentPath
MailMessage.Fields.Update(
MailMessage.Send(
MailMessage = Nothin
Catch e As System.SystemExceptio
EventLog.WriteEntry("Error", "Mail is not send, error: " & e.Message, System.Diagnostics.EventLogEntryType.Error, 1
End Try