[TYPO3] Need help for using t3lib_formmail

Peter Klein peter at umloud.dk
Wed Nov 22 16:17:39 CET 2006


Hi Laurent.
I just use the class.t3lib_htmlmail.php, like this (adm my attachments 
works):

-- cut --
  $mail = t3lib_div::makeInstance('t3lib_htmlmail');
  $mail->start();
  $mail->useBase64();

  $mail->plain_text_header = "Content-Type: text/plain; 
charset=iso-8859-1\nContent-Transfer-Encoding: quoted-printable";
  $mail->html_text_header = "Content-Type: text/html; 
charset=iso-8859-1\nContent-Transfer-Encoding: quoted-printable";

  $mail->subject = $this->subject;
  $mail->from_email = $this->fromEmail;
  $mail->from_name = $this->fromName;
  $mail->organisation = $this->organisation;
  $mail->replyto_email = $this->replyToEmail;
  $mail->replyto_name = $this->replyToName;
  $mail->mailer = $this->mailerName;
  $mail->setRecipient($this->recipientName);
  $mail->recipient_copy = $this->recipient_copy;

  while (list(, $value) = each($this->file)) {
   $mail->addAttachment($value);
  }

  $mail->setPlain($this->emailText);

  $mail->setHeaders();
  $mail->setContent();

  $mail->sendTheMail();
-- cut --

Maybe you can use the above?

-- 
Peter Klein/Umloud Untd

"Laurent Signorini" <lsignorini at ariane-ingenierie.fr> skrev i en meddelelse 
news:mailman.1.1164107178.23782.typo3-english at lists.netfielders.de...
> Hello,
>
> I would like ti use t3lib_formmail::addAttachment to send mail with 
> attached but it doesn't works.
>
> i use the following code :
> require_once (PATH_t3lib."class.t3lib_htmlmail.php");
> require_once (PATH_t3lib."class.t3lib_formmail.php");
> $msg = t3lib_div::makeInstance("t3lib_formmail");
> $V['subject'] = $sujet;
> $V['recipient'] = $destinataires;
> $V['message'] = $corps;
> $V['from_email'] = $from;
> $V['from_name'] = $name;
> $msg->start($V);
> if (!$msg->addAttachment($absoluNameFile,$fileName)) echo "PB avec 
> attachement : ".$hashNameFile." file: ".$fileName;
> $msg->sendTheMail();
>
> I well receive the mail with his body but without the file attached.
> Thanks for helping me.
>
> Regards
>
> LAurent 





More information about the TYPO3-english mailing list