Announcement

Collapse
No announcement yet.

email / starttls

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • email / starttls

    Anybody has been succesful sending an email with starttls using the standard sc emailer?
    Albert Drent
    aducom software netherlands
    scriptcase partner, reseller, support and (turn-key) development
    www.scriptcase.eu / www.scriptcase.nl

  • #2
    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.

    Comment


    • #3
      Originally posted by ionutberlea View Post
      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.
      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 Drent
      aducom software netherlands
      scriptcase partner, reseller, support and (turn-key) development
      www.scriptcase.eu / www.scriptcase.nl

      Comment


      • #4
        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]);
        }

        Comment


        • #5
          Tnx Gerd,
          This is very helpful.
          Albert Drent
          aducom software netherlands
          scriptcase partner, reseller, support and (turn-key) development
          www.scriptcase.eu / www.scriptcase.nl

          Comment

          Working...
          X