A question about #include files

 

Morning all,


So I have an include file, string formatted, which is supposed to go into the body of an email when the SendMail function is called.

Despite me working with #include files in order to avoid coding duplicate coding or text, this particular include file is not being inserted into my emails, despite never having had this problem prior.  The Email function is being called from the EA mql4 file.

My code is as follows:

//+------------------------------------------------------------------+
//|                            master_diagnostics_email_template.mqh |
//|                        Copyright 2022, MetaQuotes Software Corp. |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2022, MetaQuotes Software Corp."
#property link      "https://www.mql5.com"
#property strict
#include <global_declarations.mqh>
#include <email_disclaimers.mqh>

void master_diagnostics_email_template(){

      
      
      string disclaimer;
      string text_from_order_select_functions = "test"
      string symbol = Symbol(); 

      
      SendMail("Trade Notification Message (TNM)",
      "A position has successfully been placed on the "+text_from_order_select_functions+", "+symbol+" chart"
      "\n"+
      "\n"+//various text functions
      "\n"+
      "\n"+disclaimer);  
      
 return; //returns to the calling function within the EA MQL4 file
 
 }

Here is the disclaimer document. The name of the file is "

email_disclaimers.mqh
//+------------------------------------------------------------------+
//|                                            email_disclaimers.mqh |
//|                        Copyright 2022, MetaQuotes Software Corp. |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2022, MetaQuotes Software Corp."
#property link      "https://www.mql5.com"
#property strict

string email_disclaimers(){


   string disclaimer = 
      "\n========================================="+
      "\n"+     
      "\nPRIVACY NOTICE"+
      "\n"+
      "\nThis automated email is intended for the recipient stated at the address at the top of this email. If you have received this in error, please forward this email immediately to globalcompliance@xxxx.com, then delete this from your email client"+
      "\n"+
      "\nThis is an unmonitored email address, please do not reply to this message. If you have any queries, then please contact the Technical Administration Team on the company Skype service if you're an employee, or email them on tech.assist@xxx.com"+
      "\n"+
      "\nRegistered Company Number xxx. Registered in xxx"+
      "\n"+
      "\n=========================================";
      
      return disclaimer; //returns "disclaimer" string to the email function.

}

Why is the emails_disclaimer.mqh file not being included in the email body? 

I have also refreshed the MQL4 file as well.

Many thanks

 
TheHonestPrussian:

Morning all,


So I have an include file, string formatted, which is supposed to go into the body of an email when the SendMail function is called.

Despite me working with #include files in order to avoid coding duplicate coding or text, this particular include file is not being inserted into my emails, despite never having had this problem prior.  The Email function is being called from the EA mql4 file.

My code is as follows:

Here is the disclaimer document. The name of the file is "

Why is the emails_disclaimer.mqh file not being included in the email body? 

I have also refreshed the MQL4 file as well.

Many thanks

You didn't call the email_disclaimers() function. 

void master_diagnostics_email_template(){

      
      
      string disclaimer=email_disclaimers();
etc...
 
Laszlo Tormasi #:

You didn't call the email_disclaimers() function. 

What a pleb I am ;) 

Thanks