SendMail - Multi-Line Emails?

 
Hello everyone,
First post from me so go easy.
I'm no programmer but over the last few days thought i'd give it a go.
I have made an alert indicator that I want to email me specific, more complex email.

After some reading I found and used the SendMail(Subject,Body) function well. It worked completely fine and sent the email through my own vps no trouble at all. This worked when the body of the email was just a single line.
However now I want the body of the email to contain considerably more information about the trade. I saw in someone elses code " \n" which I presumed just hits a new line. However, with the email when the alert happens the journal now shows "Mail: 451 See http://pobox.com/~djb/docs/smtplf.html" which explains how the error is something to do with ASCII?
I then receive a second message in the journal saying "Mail (subject) failed"

Not sure where to go from here. I must be using that \n wrong or something.

Any help would be appreciated.
 
carsomyr:
Not sure where to go from here. I must be using that \n wrong or something.

It sounds like your mail server simply requires you to use \r\n rather than just \n. (This is a relic of the days of dumb terminals, where \n was a line feed and \r was a carriage return - ASCII codes 10 and 13. To move the cursor to the start of a new line, rather than just scrolling down one line, you therefore needed to do \r\n. However, most modern software will interpret any of \r, \n, or \r\n as meaning "new line".)

 
That's fantastic.
Thanks JJC, solved the problem. It's a Media Temple VPS, incase anyone in the future is curious.

Another very quick question while your here.
Is it possible to bold words in these emails using any similar ASCII code?
 
carsomyr:
Another very quick question while your here.
Is it possible to bold words in these emails using any similar ASCII code?

No. Bold, italics etc require HTML-formatted email, which MT4 doesn't have native support for. There's a discussion of how to send HTML email in topics such as https://www.mql5.com/en/forum/123932

 
Here's another solution: https://www.mql5.com/en/forum/124238
 
Thanks for that guys, problem solved :)
Going to leave the formatting for now
 
carsomyr:

Is it possible to bold words in these emails using any similar ASCII code?

While plaintext itself does not have text formatting codes there is still one last possibility: try to use _this_ and *this* and /this/ to make words underlined, bold or italic. These codes are (like the standardized smileys) sometimes correctly interpreted by plaintext email clients. Mozilla Thunderbird is such an example.

 
7bit:

While plaintext itself does not have text formatting codes there is still one last possibility: try to use _this_ and *this* and /this/ to make words underlined, bold or italic. These codes are (like the standardized smileys) sometimes correctly interpreted by plaintext email clients. Mozilla Thunderbird is such an example.

My oh my 7bit - don't tell me you're proposing to write a solution which will SOMETIMES work? :-)

CB

 
cloudbreaker:

My oh my 7bit - don't tell me you're proposing to write a solution which will SOMETIMES work? :-)

CB

It should at least always work with the *human* receiver of the email, since these codes are also used in text messages when there is no font formatting at all, for example in usenet newsgroups or IRC channels or source code comments.

And it is even backwards compatible ;-)