4

We're currently changing our mail delivery system to use solely UTF-8.

There seems to be a problem with the sender name, when the email contains non ASCII chars (hebrew) the subject & body render ok, but the sender name, as it appears in my gmail account, becomes - ??????.

There is a line of code:

myMail.BodyPart.Charset = "UTF-8"

So I thought there should be some code of the like:

myMail.SenderName.Charset = "UTF-8"

But I can't seem to find the right code to use, assuming this would do the trick.

Ansgar Wiechers
  • 193,178
  • 25
  • 254
  • 328
yaron hochman
  • 207
  • 1
  • 3
  • 7
  • 1
    When in doubt, read the [documentation](http://msdn.microsoft.com/en-us/library/ms526453%28v=exchg.10%29.aspx). If what you want isn't in there, it's probably not supported. – Ansgar Wiechers Dec 11 '14 at 11:22

2 Answers2

1

This works for me: http://www.powerasp.net/content/new/sending_email_cdosys.asp

Dim ObjSendMail
Set ObjSendMail = CreateObject("CDO.Message") 

ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "myserver"
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = False
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60

ObjSendMail.Configuration.Fields.Update

ObjSendMail.To = to_email
ObjSendMail.Subject = subject
ObjSendMail.From = from_email

'ObjSendMail.TextBody = mensaje   'tipo texto
ObjSendMail.HTMLBody = mensaje   'tipo html

ObjSendMail.TextBodyPart.Charset = "utf-8"  'support symbols á ñ ¡

ObjSendMail.Send

Set ObjSendMail = Nothing
Hernaldo Gonzalez
  • 1,977
  • 1
  • 21
  • 32
1

This worked for me.

Set iMsg = CreateObject("CDO.Message")

With iMsg
    .BodyPart.Charset = "utf-8"
End With
Unicco
  • 2,466
  • 1
  • 26
  • 30