Sc_mail_send not working for me

Good day Developers, I have been working for a couple of days now trying to get sc_mail_send to work.
I have set all the parameters, then I call the function sc_mail_send(), but it doesn’t appear that it ever gets called, I get no error messages at all.
Here is my basic setup: You will note that I echo a statement before and after the function call, the 2nd one never gets displayed.
echo “calling sc_mail_send
”;

sc_mail_send($mail_smtp_server ,
$mail_smtp_user ,
$mail_smtp_pass ,
$mail_from ,
$mail_to ,
$mail_subject ,
$mail_message ,
$mail_format ,
$mail_copies ,
$mail_tp_copies ,
$mail_port ,
$mail_tp_connection,
$mail_attachment ,
$mail_ssl ,
$mail_ReplyTo
);

echo “ending sc_mail_send
”;

Hoping someone can point me in the right direction. Thank you.

What error are you gettting?

That’s the thing, I don’t get any errors, nothing, the script just ends abruptly.
The 2nd echo statement (echo “ending sc_mail_send") never gets triggered.
Thanks for responding to my call for help!

If you are running under php 8.x then verify that you are not passing a null value, ie if a string is expected. Pass ‘’ instead.

Yes, I am passing empty string and not nulls.
Thank you aducom.

Then the hard way. Locate the library and hack the code to set report error level. Afaik phpmailer is used. Other option is to write a small mail program from the mailer samples to see if you can get that to work. Should give you insight in what is going on because you have full control.

After calling sc_mail_send, you can check whether the email is sent successfully by inserting this code after sc_email_send.
if ({sc_mail_ok})
{
sc_alert({lang_mail_sended_ok});
}
else
{
sc_error_message({sc_mail_erro});
}

Without sc_mail_error, it is difficult to find out where goes wrong.

Thank you both.
Aducom, I’m afraid that would be above my paygrade.
paullaw, The script halts when executing sc_mail_send. The 2nd echo statement does not execute. I did have your code in there as well but again, nothing after the sc_mail_send command runs.
Yes, I am bewildered too.
Thank you.

I see.

If you don’t mind to share the value of the parameters that you pass in when calling sc_mail_send so that we have a better understanding your scenario? Of course don’t share the smtp password here. In addition, you need to have the PHP “php_openssl” extension enable in your php.ini if using secure connection.

OK, here goes. I hope it helps.
I host on Scriptcase.host so I assume they would have php_openssl enabled.

$mail_smtp_server = ‘sitetaskcards.org’;
$mail_smtp_user = ‘XXXX@sitetaskcards.org’;
$mail_smtp_pass = ‘XXXXXXXXX’;
$mail_from = ‘XXXX@sitetaskcards.org’;
$mail_to = ‘XXXX@sitetaskcards.org’;
$mail_subject = ‘sc_mail’;
$mail_message = ‘sc_mail send test’;
$mail_format = ‘T’; // ‘T’ for text, ‘H’ for HTML
$mail_copies = ‘’; // List of email addresses separated by ;
$mail_tp_copies = ‘’; // BCC or CCC
$mail_port = ‘465’;
$mail_tp_connection = ‘S’; // Ssl or Tls or None
$mail_attachments = ‘’;
$mail_ssl = ‘’; //optional SSL parms
$mail_ReplyTo = ‘XXXX@sitetaskcards.org’;

echo “calling sc_mail_send
”; // THIS ECHO PRINTS TO SCREEN. THE FOLLOWING ONE DOES NOT

sc_mail_send($mail_smtp_server ,
$mail_smtp_user ,
$mail_smtp_pass ,
$mail_from ,
$mail_to ,
$mail_subject ,
$mail_message ,
$mail_format ,
$mail_copies ,
$mail_tp_copies ,
$mail_port ,
$mail_tp_connection,
$mail_attachments ,
$mail_ssl ,
$mail_ReplyTo
);

echo “ending sc_mail_send
”; THIS ECHO DOES NOT DISPLAY NOR ANYTHING BELOW THIS

if ({sc_mail_ok}){
echo “
Message sent successfuly”;
}else{
echo “
Message failed !”;
}

All parameters looked OK to me except $mail_tp_copies = ‘CCC’ (refer to Help file). If still not working, you may try using google smtp to test.

I tried your $mail_tp_copies suggestion, no change and I have already tried gmail smtp, no change.
Thanks for your suggestions and kind attention to my issue. I guess I now need to bring the issue to Scriptcase’s attention. But I will also keep listening here, there is a wealth of knowledge in this forum.

Sorry to hear that your sc_mail_send still not working. I have used sc_mail_send since version 8 and have no problem to send email using our company smtp mail server.

Recently I have also switched to phpMailer which provides debug feature and it is easier to troubleshoot when there is any problem. You can search in this forum regarding PHPMailer.

Good Luck!