HTML メールを生成して顧客に送信するアプリケーションです。これは、一部の文字 ( ) & * % $ # @ ! を除いて機能します。〜; _ = + / - ? ' 動作しません。以下は私が使用するコードです。HTML メールでこれらの特殊文字を許可する方法を教えてください。
Sub subHtmlEmail(ByVal strAddresseeEmail As String, ByVal strGroup As String)
Try
Dim strTo, strFrom, strBody, strSubject, strBcc As String
Dim boolHtml As Boolean = True ' set the body content to plain text(false) or HTML(true)
strFrom = "sales@mycompany.com"
strTo = strAddresseeEmail ' ; Separates emails
strBcc = "" ' ; Separates emails
strSubject = txtEmailSubject.Text
strBody = "<html><head></head><body>"
strBody = strBody & "<img src=cid:Logo>"
strBody &= "<br><br>"
strBody &= "Dear " & clsGroupCustomers.RetrieveAddressee(strAddresseeEmail, strGroup) & ",<br><br>"
Dim strLines As String() = txtBody.Text.Split(New [Char]() {CChar(vbCrLf)})
For Each strLine As String In strLines
strBody &= strLine & "<br>"
Next
strBody &= "<br><br>"
Dim strFooterLines As String() = txtFooter.Text.Split(New [Char]() {CChar(vbCrLf)})
For Each strFooterLine As String In strFooterLines
strBody &= strFooterLine & "<br>"
Next
HTMLView = AlternateView.CreateAlternateViewFromString(strBody, Nothing, "text/html")
strBody &= "</body></html>"
subEmail(strFrom, strTo, strBcc, strSubject, strBody, boolHtml, strAddresseeEmail)
Catch ex As Exception
Cursor = Cursors.Default
MsgBox("An error has occurred in your application while attempting to create the email." & Chr(13) & Chr(13) & "Description: " & ex.Message & Chr(13) & Chr(13) & "Please contact your System Administrator.", MsgBoxStyle.Critical, "Application Error")
Exit Sub
End Try
End Sub