Download MetaTrader 5

Carriage Return '\n' for SendMail()

To add comments, please log in or register
Marcelo Coutinho
1202
Marcelo Coutinho  

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
35119
Alain Verleyen  
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
1202
Marcelo Coutinho  
angevoyageur:

What is not working ? What did you get ?

Flat line ... like having no \n command.
Alain Verleyen
Moderator
35119
Alain Verleyen  
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
1202
Marcelo Coutinho  
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