Hello,
I can’t send a mail on form with AfterInstert section. It sends well on SC platform but when I deploy my application, it don’t send mail. I tried without attachment and it worked well, how can I send mail with attachment on the live platform?
My codes:AfterInsert:
// Email parameters
if ( {attachment} !=null ) {
$file=$this->Ini->path_doc.’/’.{attachment};
$fileName = " | ‘".{attachment}."’ files.";
}
else{
$file=NULL;
$fileName=NULL;
}
$mail_smtp_server = ‘ssl://smtp.gmail.com’; // SMTP server name or IP address
$mail_smtp_user = ‘b@a.com’; // SMTP user name
$mail_smtp_pass = ‘1234’; // SMTP password
$mail_from = ‘b@a.com’; // From email
$mail_to = ‘a@b.com’; // To email
$mail_subject = 'New Report Request: '.{report}; // Message subject
$mail_message = 'Report Name: ‘.{report}.’ .$fileName; // Message body
$mail_format = ‘H’; // Message format: (T)ext or (H)tml
$mail_attachments = $file;
// Send email
sc_mail_send($mail_smtp_server,
$mail_smtp_user,
$mail_smtp_pass,
$mail_from,
$mail_to,
$mail_subject,
$mail_message,
$mail_format,
‘’,
‘’,
‘465’,
‘’,
$mail_attachments);
This codes only works locally, SC platform. Does not work with attachment on the live.