Jump to content

Welcome to Geeks to Go - Register now for FREE

Geeks To Go is a helpful hub, where thousands of volunteer geeks quickly serve friendly answers and support. Check out the forums and get free advice from the experts. Register now to gain access to all of our features, it's FREE and only takes one minute. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more.

Create Account How it Works

CDO - ASP E-mail Character Displays incorrectly

  • Please log in to reply




  • Member
  • PipPipPip
  • 216 posts
I'm having a small issue with our CDO mailing system. We are sending out a text newsletter, and for the most part it is sending well. The problem we have is when we use certain characters they do not appear correctly when the user receives the message.

Sample Message: "PS – don’t forget"

Set cdoConfig = CreateObject("CDO.Configuration")  		With cdoConfig.Fields  	.Item(cdoSendUsingMethod) = cdoSendUsingPort  	.Item(cdoSMTPServer) = "mail.mysite.net"	.Item(cdoSMTPAuthenticate) = 1 	.Item(cdoSendUsername) = "[email protected]" 	.Item(cdoSendPassword) = "$$$$$$$$$$$"  	.Update  End With Do While not rsrsMysiteBase.EOF	msgstring = messageStringForMailing	Set cdoMessage = CreateObject("CDO.Message")  	With cdoMessage 		Set .Configuration = cdoConfig 		.BodyPart.Charset = "utf-8"		.From = "[email protected]" 		.To = rsMysiteBase("email")		.Subject = "Mysite Newsletter"		.TextBody = msgstring 		.Send 	End With End If	'Move to the next record in the recordset	rsMysiteBase.MoveNext

Result: "PS â?" donâ?Tt forget"

(The Quotations "", are not part of the message)

The message is passed through this form:

<form method="POST" action="functions/sendnewsletter2.asp">      <p>      <label>Message in Body:<br /><textarea name="message" id="message" cols="50" rows="5" tabindex="2"></textarea>      </label>      </p>      <p><br />      	<input type="submit" value="Send Mailing" name="newsletterbtn" tabindex="3"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;        <input type="submit" value="Preview Mailing" name="newsletterbtn" tabindex="3">      </p>    </form>

and placed in the message by use of this retrieval:
messageStringForMailing = Request.Form("message")

Any help would be greatly appreciated. Thanks!

-Matt McCracken
  • 0





  • Member
  • PipPip
  • 17 posts
While I have zero experience with ASP, I have had this same problem in the past with other web scripts. It sounds like you are copy and pasting the email to be sent out of Microsoft Office. Microsoft Office changes quotations, dashes, and other special characters into their own "smart" characters. This causes the problem you are seeing. The easiest way to fix this is by changing Microsoft Office settings:
A short tutorial of how to do that can be found at HERE

Another way you can do it is by making the script automatically replace all characters that Microsoft Office changes.

For example, I believe in ASP, it would be something like:
emailStr = Replace(emailStr, "<copy and paste of Microsoft office dash>", "-")
Obviously, remove "<copy and paste of Microsoft office dash>" and do what it says. Then copy this method for all the other special characters (open and close single and double apostrophes, etc).

However, if you are not actually copy and pasting from Microsoft Office, then obviously my solution does not work so please let me know if I am off target.

I hope this helps.

PS: As I stated earlier, I have zero experience with ASP so take my code snippet with a grain of salt. I basically used the ASP equivalent of PHP's str_replace() because that is how I fixed my problem.

Edited by Raikia, 10 January 2011 - 03:53 AM.

  • 0

Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP