Download MetaTrader 5

Carriage Return '\n' for SendMail()

To add comments, please log in or register
You sell neither signals nor apps? No problem, everyone can make profit!
Marcelo Coutinho
1151
Marcelo Coutinho 2014.05.27 21:40 

Hi there !

Can someone please help me here ?

I saw that was necessary to include \n but it is not working.

Thank you in advance 

void EnvioDeEmail(string tipo)
  {
   string corpo_email=" login: "+(string)login+
                      " ticks: "+(string)ticks+
                      " | MAF1: "+DoubleToString(iMA_buf_fast[1],4)+"\n"+
                      " | MAS1: "+DoubleToString(iMA_buf_slow[1],4)+"\n"+
                      " | DIF[1]: "+DoubleToString(iMA_buf_fast[1]-iMA_buf_slow[1],4)+"\n"+
                      " | MAF0: "+DoubleToString(iMA_buf_fast[0],4)+"\n"+
                      " | MAS0: "+DoubleToString(iMA_buf_slow[0],4)+"\n"+
                      " | DIF[0]: "+DoubleToString(iMA_buf_fast[0]-iMA_buf_slow[0],4)+"\n"+
                      " | MACD1: "+DoubleToString(iMACD_buf_main_line[1],2)+"\n"+
                      " | MACD0: "+DoubleToString(iMACD_buf_main_line[0],2)+"\n"+
                      " | StdDev: "+DoubleToString(iStdDev_buf[0],2)+"\n"+
                      " | contratosAtual: "+(string)contratosAtual+"\n"+
                      " | contratos: "+(string)contratos+"\n"+
                      " | order: "+(string)order+"\n"+
                      " | orderAtual: "+(string)orderAtual;

   if(!SendMail(tipo,corpo_email))
     {
      Print("[Falha ao enviar email. Erro: ",GetLastError(),"]");
      ResetLastError();
     }
  }
//+------------------------------------------------------------------+
Alain Verleyen
Moderator
30711
Alain Verleyen 2014.05.27 22:33  
YouTrade:

Hi there !

Can someone please help me here ?

I saw that was necessary to include \n but it is not working.

Thank you in advance 

What is not working ? What did you get ?

Marcelo Coutinho
1151
Marcelo Coutinho 2014.05.28 02:35  
angevoyageur:

What is not working ? What did you get ?

Flat line ... like having no \n command.
Alain Verleyen
Moderator
30711
Alain Verleyen 2014.05.28 10:25  
YouTrade:
Flat line ... like having no \n command.

I don't have this problem.

   string message="";
   StringConcatenate(message,"Line1","\n",
                             "Line2","\n",
                             "Line3","\n");
   SendMail("Test",message);

angevoyageur@xxx 10:19 

Line1
Line2
Line3
Marcelo Coutinho
1151
Marcelo Coutinho 2014.05.28 15:01  
angevoyageur:

I don't have this problem.

angevoyageur@xxx 10:19 

Line1
Line2
Line3

I don´t have StringConcatenate !

Thank you ! 

To add comments, please log in or register