Start a conversation

Sending mail with validation message

When we use the macro sc_mail_send and we need to perform a prior validation to send the mail, simply add the following code:

This would be the code:

try 

 

    sc_mail_send('smtp.gmail.com', 'usuario1@gmail.com', 'contrasenha1234','usuario1@gmail.com' , 'usuario2@hotmail.com', 'Test', 'Message test', 'T', '', '',465, 'S', '', '','allow_self_signed=true;verify_peer=false'); 

} 

catch (Exception $var_error_fatal) 

{ 

sc_error_message("'There was an exception when sending mail: " . $var_error_fatal->getMessage() . "<br>"); 

 

And this would be the result when executing and loading incorrect data:


Choose files or drag and drop files
Was this article helpful?
Yes
No
  1. Silvana Vargas

  2. Posted
  3. Updated

Comments