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.
The ASP Free website provides in-depth information on the latest developer tools available from Microsoft. Our cadre of writers, highly experienced industry experts, reveals the best ways to use established technologies as well as new and emerging technologies. Our coverage of Microsoft's development and administration technologies is among the most respected in the IT industry today.
ASP Free and Iron Speed Designer are giving away $5,500+ in FREE licenses. Iron Speed's RAD CASE toolset can save up to 80% of your coding time. One free license per week, one perpetual license per month! Download and Activate to enter!
Intel® Graphics Performance Analyzers is a powerful tool suite for analyzing and optimizing your games, media, and graphics-intensive applications. Used by some of the best developers on the planet, Intel GPA lets you maximize your app’s performance.
Posts: 404
Time spent in forums: 3 Days 2 h 27 m 38 sec
Reputation Power: 168
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?
Posts: 404
Time spent in forums: 3 Days 2 h 27 m 38 sec
Reputation Power: 168
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...
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.
Posts: 7,322
Time spent in forums: 8 h 13 m 55 sec
Reputation Power: 30
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.
Posts: 7,322
Time spent in forums: 8 h 13 m 55 sec
Reputation Power: 30
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 10:15 AM.