Anybody has been succesful sending an email with starttls using the standard sc emailer?
Until certain update on scriptcase 8 i use email macro. I notice that macro uses swiftmailer and i start to call swiftmailer directly without sc macro. Swift mailer no longer accept any part of email address (to,cc,bcc) as simple string, only array like $to = array (‘email’ => ‘name’).
I think sc macro is not updated but swiftmailer it is in third libraries.
[QUOTE=ionutberlea;37438]Until certain update on scriptcase 8 i use email macro. I notice that macro uses swiftmailer and i start to call swiftmailer directly without sc macro. Swift mailer no longer accept any part of email address (to,cc,bcc) as simple string, only array like $to = array (‘email’ => ‘name’).
I think sc macro is not updated but swiftmailer it is in third libraries.[/QUOTE]
Tnx for your reply. I requested it by Sc to modify. Do you have a code snippet by any chance how to do that? I can find out myself, but it’s always helpful.
Albert, her is how i do it:
$transport = Swift_SmtpTransport::newInstance($_SESSION[“hse_sss”][“mailserver”])
->setUsername($_SESSION[“hse_sss”][“mailsuser”])
->setPassword($_SESSION[“hse_sss”][“mailspswd”])
;
// Create the Mailer using your created Transport
$mailer = Swift_Mailer::newInstance($transport);
// Create a message
$message = Swift_Message::newInstance($mailcsubject)
->setFrom(array($_SESSION[“hse_sss”][“mailsfrom”] => $mailcsubject))
->setTo(array($usermail => $username))
->setBody(
‘<html><head></head><body>’ .
’ Hallo <b>’ . $prename . ‘</b> !<br><br>’ .
’ </body></html>’,‘text/html’)
->attach(Swift_Attachment::fromPath($var_datapath.$observ)->setFilename(‘triggermessage’));
;
if ($mailer->send($message)){
$action = ‘Mail sent’;
}
else
{
$action = ‘Mail not sent’;
setAktLogApp($userlogin,[title],$action,$description,[usr_login]);
}
Tnx Gerd,
This is very helpful.