This would be simple if I could point swiftmailer at the content of a webpage and let it pick up the whole thing and email it to my list. Is it possible?
emailing a web page like m/s explorer to a list
Moderators: Chris Corbyn, General Moderators
emailing a web page like m/s explorer to a list
I wonder if Swiftmailer could email a webpage (with ALL images etc embedded) as ms explorer does, but modified to cover multiple addresses?
This would be simple if I could point swiftmailer at the content of a webpage and let it pick up the whole thing and email it to my list. Is it possible?

This would be simple if I could point swiftmailer at the content of a webpage and let it pick up the whole thing and email it to my list. Is it possible?
You mean to say something like
would load the contents of http://devnetwork.net of into the body ?
Code: Select all
$message = new Swift_Message("Some subject", "http://devnetwork.net", "text/html");- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
You can embed images manually into the HTML: http://www.swiftmailer.org/wikidocs/v3/ ... ing_images
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
roscoe - as an alternative to a plugin solution, simply do
Code: Select all
$body = file_get_contents($url);
if ($body === FALSE) die();
$message = new Swift_Message("Some subject", $body, "text/html");Would that embed all images too???anjanesh wrote:roscoe - as an alternative to a plugin solution, simply doCode: Select all
$body = file_get_contents($url); if ($body === FALSE) die(); $message = new Swift_Message("Some subject", $body, "text/html");
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Someone seems to have written a function addImage (Bonus section) with a complete tutorial at cakephp !
http://bakery.cakephp.org/articles/view ... t-tutorial
http://bakery.cakephp.org/articles/view ... t-tutorial
One thing that is nice with Swift Mailer, is a function called addImage, it embeds an image into the body of the email to display inline.
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
That was old code from version 2.x of Swift Mailer. I wrote the addImage() method in version 2. In version 3 the functionality still exists, you just need to use Swift_Message_Image instead:anjanesh wrote:Someone seems to have written a function addImage (Bonus section) with a complete tutorial at cakephp !
http://bakery.cakephp.org/articles/view ... t-tutorial
One thing that is nice with Swift Mailer, is a function called addImage, it embeds an image into the body of the email to display inline.
Code: Select all
$message->attach(new Swift_Message_Image(new Swift_File("/path/to/image.jpg")));