ERR_SEND_MAIL_ERROR (4061)

 

Hi folks,

I've Google a bit and not been able to find an answer . . .

ERR_SEND_MAIL_ERROR (4061), what problems/issues/faults can cause this error to be generated ?

thanks in advance.

 
Most email providers require SSL which mql4 doesn't support. Ask your internet provider if they have a non-ssl server.
 
WHRoeder:
Most email providers require SSL which mql4 doesn't support. Ask your internet provider if they have a non-ssl server.


Sorry, you are misunderstanding my question. I have email working no problem . . . I want to understand what causes the error so that I can use it in my EA to detect certain issues/problems . . . but unless I know what can cause the error I don't know what it is telling me.

For example, would this error be generated if my EA tried to send email and the SMTP Server field was empty in the MT4 Options>Email tab ?

 

OK, I did a little testing . . . I got this error if I have no SMTP Server set . . .

I'm trying to help my EA users by giving them helpful error messages when I can.

 

Thanks, Raptor, for link  http://www.forexfactory.com/showthread.php?t=273034 , where I've found lots of helpful info.

I got ERR_SEND_MAIL_ERROR (4061) when running the following script;

Probably, OrderSend() function cannot complete if MT unable to e-mail for some reasons, one obvious reason is when SMTP server is not set.

Is there a way to disable e-mail functionality when I don't need it, especially in testing the program and demo trading?

 
elik57:

Thanks, Raptor, for link  http://www.forexfactory.com/showthread.php?t=273034 , where I've found lots of helpful info.

I got ERR_SEND_MAIL_ERROR (4061) when running the following script;

Probably, OrderSend() function cannot complete if MT unable to e-mail for some reasons, one obvious reason is when SMTP server is not set.

Is there a way to disable e-mail functionality when I don't need it, especially in testing the program and demo trading?

Just set a bool to true when email should be enabled and false when not,  for example  . . . .

bool EnableEmail;

if(IsDemo() || IsTesting()) EnableEmail = false;
else EnableEmail = true;

if(EnableEmail) SendMail( . . . );
Reason: