on a project with intensive emailing activity we are creating asynchronnous workflow for posting emails. Workflow consists of 2 steps:
creating the message (we set Subject, From, to, body, attachments), then converting to a string via
$mailer->toString()
and store into database.get few latest emails from database and send them out to user(s).
String stored into database is actually valid multipart EML file (e.g. can be open with Outlook) with message headers + body.
QUESTION:
How can I send message converted toString via SwiftMailer using it's transport capabilities?
Thank you.
Example of stored string in the database:
Message-ID: <1803a1a74c7612e43d58a8ca558117f3@refactoring.local>
Date: Mon, 16 Oct 2017 13:50:31 +0200
Subject: Sample subject
From: info@refactoring.local
Reply-To: info@refactoring.local
To: aaa@bbb.cc
MIME-Version: 1.0
Content-Type: multipart/alternative;
boundary="_=_swift_v4_1508154632_faf5d3b80866048d993d77a62a9e6497_=_"
--_=_swift_v4_1508154632_faf5d3b80866048d993d77a62a9e6497_=_
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
sample body ...
--_=_swift_v4_1508154632_faf5d3b80866048d993d77a62a9e6497_=_
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org=
/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns=3D"http://www.w3.org/1999/xhtml">
<head>
=09<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3DUTF-8"=
/>
=09<title>Sample title</title>
=09</head>
<body>
=09=09
=09sample body ...
=09</body>
</html>
--_=_swift_v4_1508154632_faf5d3b80866048d993d77a62a9e6497_=_--