The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.
|
 |
|
Dev Shed Forums
> Programming Languages - More
> ASP Programming
|
Simple (Hopefully!) CDONTS Question
Discuss Simple (Hopefully!) CDONTS Question in the ASP Programming forum on Dev Shed. Simple (Hopefully!) CDONTS Question ASP Programming forum discussing Active Server Pages coding techniques and problem solving methods. Use VBScript or Jscript to make dynamic web applications.
|
|
 |
|
|
|
|

Dev Shed Forums Sponsor:
|
|
|

February 5th, 2003, 04:15 AM
|
 |
Purple is a Fruit
|
|
Join Date: Oct 2002
Location: Ireland
|
|
|
Simple (Hopefully!) CDONTS Question
Hey,
I have a script sending mail with asp using CDONTS. The script works fine, the only problem I have is specifying a new line in the message body. I am used to php's imap commands where you can just set the body to be "Hi\nThis is on a new line!" but putting \n in the text of the CDONTS mail just displays the \n as part of the text. Any ideas on how to set a new line in the text?
Thanks for reading 
|

February 5th, 2003, 09:00 AM
|
|
Registered User
|
|
Join Date: Jan 2003
Posts: 23
Time spent in forums: 20 m 12 sec
Reputation Power: 0
|
|
|
Have you tried using the HTML <br> tag?
|

February 5th, 2003, 09:10 AM
|
 |
Purple is a Fruit
|
|
Join Date: Oct 2002
Location: Ireland
|
|
|
Hey,
No, I don't want to send the mail as a html mail. Just as a plain text mail. I presume the newline character for text is \n, I'm just not sure how to implement it using CDONTS...
Thanks
|

February 5th, 2003, 03:30 PM
|
|
Junior Member
|
|
Join Date: Jan 2003
Posts: 29
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
I think the problem is that php doesn't interpret what's between quotes. In VBScript, the solution is:
"Hi" & vbNewLine & "This is on a new line."
vbNewLine is a pre-defined character string that contains a hard return and a linefeed -- chr(13) & chr(10)
I think you need to do the same thing in php -- glue together two strings, with a third string made up of a hard return and a linefeed between the two.
Sorry, I don't speak php. But hopefully you can translate from the VBS example above.
Charlie
|

February 6th, 2003, 04:01 AM
|
 |
Purple is a Fruit
|
|
Join Date: Oct 2002
Location: Ireland
|
|
Hey,
Thanks that worked a treat. Oddly in PHP, it's enough to just place the \n character within the quotes and it will create a newline.
Thanks again 
|

February 6th, 2003, 05:36 AM
|
 |
Second highest poster :p
|
|
|
|
|
Welcome to the differences in Structured and Unstructured Programming. VB is unstructured code. PHP, Java, C is structured.
What does this mean? In structured languages you have ; at the end of lines, if statements use () to hold the condition, \n \t \r etc is available, using {} to denote code areas, the list goes on
On unstructured languages you dont have anything to denote end of lines, if statements have if condition then do this which is more like english and less like programming. Also things like all the special characters are not available. You use things like endif and wend to close code areas.
This is just a breif outline of the differences.
|

February 24th, 2003, 08:44 AM
|
|
Junior Member
|
|
Join Date: Feb 2003
Location: London
Posts: 1
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
oh please!
what you are harping on about there are differences in syntax.
these have nothing whatsoever to do with structure.
vb is as structured as those other languages you mention, regardless of whether or not you can get you head around the syntactical differences.
|

February 24th, 2003, 09:10 AM
|
 |
Second highest poster :p
|
|
|
|
Have you any formal programming training? Structured & Unstructured are simple programming concepts and are general categories.
BASIC code uses stuff like "if condition then this else that" and "goto overthere" meaining its unstructured. VB is based on BASIC. It has been called that since the languages were developed. Things like C were always known as structured since they had functions and code looked like "if (condition) { this; } else { that; }".
VB has functions and some of the things that structured programming has but its still refered to as an unstructured language. Take a step back in history and read this http://www.chisp.net/~dminer/c64/ga...01/8801088.html
It may be old but it shows what i mean. 
Last edited by a.koepke : February 24th, 2003 at 09:15 AM.
|
Developer Shed Advertisers and Affiliates
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|