How to pass HTML related signs in an e-mail text?

Hi,

In HTML I have a problem with a variable value ‘2 - Puppy class 6-<9 months’.
This line of the message for the e-mail stops before the ‘<’ sign.

Several ways for applications using HTML, as found at the web, fail.
I had to remove the important ‘<’ value from the field values.

For a MySQL database a disturbing comma in a field value can be preceded by a backslash.
Databases have all their own ways to manage such problems.

It seems to me that ScriptCase must have a way to handle.
Maybe it’s for a specialist. Please add your opinion.

Regards
Jan Willem

For " charachter works with \ char! I didnt tried your sample, but maybe &lt; should work.

Try to use htmlspecialchars or addslashes php function to your string

HTML related characters are passed correctly with function htmlspecialchars()

Thanks for the hint. The function htmlspecialchars() works fine.
Actually, in my previous tests the ‘;’ character in “<” missed.

$ClassNo = {ClassNo};
$sql = “SELECT ClassName FROM ClassesPortalLog WHERE ((ClassLanguage = ‘[Language]’) AND (ClassNo = {ClassNo}))”;
sc_lookup(cn, $sql, “conn_mysql2”);
if (isset({cn[0][0]}))
{
$ClassNoLimited = $ClassNo . " - " . str_replace("<", “<”, {cn[0][0]});
$ClassNo .= " - " . htmlspecialchars({cn[0][0]});

}

Part of the mail message:
$mail_message .= {lang_EntriesPortalLog_fld_ClassNo} . " = " . $ClassNoLimited . “<br>”;
$mail_message .= {lang_EntriesPortalLog_fld_ClassNo} . " = " . $ClassNo . “<br>”;

Output in Dutch:
Klasse nummer = 4 - Tussenklas 15-<24 mnd.
Klasse nummer = 4 - Tussenklas 15-<24 mnd.

Regards

Jan Willem

It’s suppose should work for “<” too.
http://docs.php.net/manual/en/function.htmlspecialchars.php

‘<’ (less than) becomes ‘<’

The problem is solved. The line $ClassNoLimited demonstrates the replace function for only value “<”. However in received mail about the thread it gets translated to <.

Email is the most popular Internet service today. A plenty of emails are sent and delivered each day. To write an email link, create a link like you would normally, but instead of http:// write mailto: and then the email address you want them to mail to. For example, to set up a link to email me, you would write (replacing ?CHANGE? with my email address):

<a href=“mailto:CHANGE”>mail the Web Design/HTML Guide</a>
If you want the message to go to multiple email addresses, separate the email addresses with a comma:

<a href=“mailto:CHANGE”>mail the Web Design/HTML Guide</a> mailto:email@address1.com,email@address2.com
But there is so much more that you can do with the mailto links. Most modern web browsers and email clients support more than just the ?To? line. You can specify the Subject, send carbon copies, and blind carbon copies.