That is correct! I am able to echo before sending, but the message body is empty every time.
Problem with '&' charachter.
Collapse
X
-
There's a couple of possibilities here. The first idea is that the command line arguments passed to sendmail aren't escaped, so the shell sees the ampersand as the "run in background" operator instead of part of the message. That's not a good thing.
If the email breaks when the body contains quotes, a pipe ("|") or greater than as well, that's a good indication of what's going on.
The other alternative is that sendmail itself is doing something wrong with the ampersand.
Ultimately, my recommendation would be to use a class such as PHPMailer or Swift Mailer instead of relying on sendmail. Both PHPMailer and Swift Mailer implement SMTP independently of sendmail for better compatibility.Comment
-
Well I've learnt something there. This is what I was trying to get at but didn't know for sure, so with your input I have discovered something new.Originally posted by pbmodsThere's a couple of possibilities here. The first idea is that the command line arguments passed to sendmail aren't escaped, so the shell sees the ampersand as the "run in background" operator instead of part of the message. That's not a good thing.
If the email breaks when the body contains quotes, a pipe ("|") or greater than as well, that's a good indication of what's going on.
I love this forum.
nathjComment
-
The presence of \ is simpy mail() escaping the quotes. If you want rid of those simply use stripslashes() and that will sort you out.Originally posted by zamuelOk, I have discovered few other errors. Additionally sign '<' also causes same behavior. Also when I add " or ' the massage becomes \' or \". I am starting to suspect the XML part for the source of the error.
cheers
nathjComment
Comment