Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_cdo thread: RE: CDONTS removes the dot after www


Message #1 by "brandon paluzzi" <brandon@b...> on Thu, 24 Jan 2002 15:39:51

I was checking this out a bit, and it seems that the problem is not with 

the ASP code, it's with the way SMTP is handling the mail after it has 

been passed to the mail server.



I tested this by echoing back the mail subject before sending, and it 

comes up on the screen correctly, although it comes up in the mail body as

http://wwwsampledomain.com  or http://www.sampledomaincom



Also, sometimes periods at end of lines are randomly removed (thanks to 

Martin for discovering this aspect)



It turns out that the SMTP server is supposed to filter out all periods by 

replacing them with double periods (the single period is a control 

character, indicating end-of-message).  In some cases (still not sure 

exactly what prompts the error, but in instances where it does occur, it 

is consistently appearing), it fails to encode the single period into a 

double period, and the single period is interpreted as a control 

character.  Since the end-of-message control sequence is actually 

<CRLF>.<CRLF>, the single period is just ignored, and ultimately dropped.





My solution to this is to remove the periods from the mail subject via the 

ASP Replace() method before it is passed to the SMTP server.  I used the 

HTML period escape character (&#46;) since I'm sending HTML mail:



 Dim mailObject

 Set mailObject = Server.CreateObject("CDONTS.newMail")

 

 Dim msgBodyText

 msgBodyText = "This is a test.  http://www.google.com"

 

 mailObject.Body = Replace(msgBodyText, ".", "&#46;")

 

 mailObject.Send

 



Martin also tried this, and it seems to work.  He also commented that the 

error only seems to happen when sending HTML mail, so the &#46; should be 

enough to solve all instances of the problem.





Hope this helps! 

Brandon Paluzzi



> Weird... can you post the code again where you're making the a link? This

> shouldn't be this problematic.

> 

> -- Tomm

> 

> > -----Original Message-----

> > From: Martin Grundy [mailto:martin.grundy@s...]

> > Sent: Monday, October 15, 2001 3:59 PM

> > To: ASP CDO

> > Subject: [asp_cdo] RE: CDONTS removes the dot after www

> >

> >

> > Tomm,

> >

> > Thanks for the suggestion. I have finally had a chance to try

> > Server.URLencode on the http reference, but now instead of

> >

> > http://wwwamrresearch.com/preview/010920alert654.htm

> >

> > I get

> >

> > http%3A%2F%2Fwww%2Eamrresearch%2Ecom%2Fpreview%2F010920alert654%2Ehtm

> >

> > which is, I suppose, what I asked for!

> >

> > (I am expecting

> >

> > http://www.amrresearch.com/preview/010920alert654.htm

> >

> > i.e. with a dot after www).

> >

> > Any other ideas?

> >




> >

> >

> 


  Return to Index