• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 311
  • Last Modified:

CDO using commas in the from field

I am using CDO to send emails but I need to have the from field appear as how Outlook would send an email, e.g. "Schmoe, Joe <joe.schmore@co.com>". I can put spaces, but when I put a comma, it truncates the portion of the code after the comma. See code below.

dim objMail 'as CDO.Message

set objMail = Server.CreateObject("CDO.Message")
with objMail
      .From = "Schmoe, Joe <joe.schmoe@co.com>"
      .To = "test@test.com"
      .Subject = "OLHDR -" & request.form("summary")
      .HTMLBody = messagebody
end with
set objMail = nothing
1 Solution
Rodney HelsensCommented:
I think you may be able to get around this using quotes, something like..

.From = """Schmoe, Joe"" <joe.schmoe@co.com>"

this is because the comma is the delimiter, so it treats must be escaped.. hope this works

how about trying the special character translation for the comma instead of the actual comma &#44;
jingalingAuthor Commented:
Thanks, worked like a charm using the extra quotes

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now