close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Question on phpmailer external link img not controllabe with css

Thread began 3/13/2023 5:53 pm by lr_leal239405 | Last modified 3/23/2023 4:54 pm by Ray Borduin | 303 views | 6 replies |

lr_leal239405

Question on phpmailer external link img not controllabe with css

I can't seem to find a solution to the following problem. I can't control the image size, on email sent using phpmailer, no matter what I do for links that pull specifically from Linkedin. So the source that comes to the email is, for example:

<figure><a href="https://www.mywebsite.com/products/ap.php" rel="noopener noreferrer" target="_blank"><img style="width:50px; height=" autoalt="No alt text provided for this image" id="ember43" loading="lazy" src="https://media.licdn.com/dms/image/D4E12AQGP40Gx347Lyw/article-inline_image-shrink_1000_1488/0/1678714121121?e=1684368000&amp;v=beta&amp;t=F0KMkmsp7r3agMZQN_Yp8u2XJPX37h78ZeZPcdtNbGU" style="height: 375px; width: 500px;"></a></figure>

The email code looks like this:

<?php
$Email = new WA_Email("newsletter");
$Email->From = "My Company <noreply@mycompany.com>";
$Email->CharSet = "UTF-8";
$Email->addTo("webmaster@mycompany.com");
$Email->BodyFile = "../webassist/email/templates/newsletter.php";
if (function_exists("rel2abs") && $Email->Redirect) $Email->Redirect = $Email->Redirect?rel2abs($Email->Redirect,dirname(__FILE__)):"";
for ($emailGroup=0; $emailGroup<sizeof($Email->To); $emailGroup++) {
$Email->Subject = "My company Newsletter";
$Email->send($emailGroup);
}
$Email->close();
?>

This is for a Newlsetter that boss writes thru Linkedin. I am using the Webassist tools to Update the content. When I paste directly from Linkedin email, it includes the photos automatically without me having to download every image that was included. I like that ...just Cut and Paste and Done. ...If I could just make the image size to obey the CSS rule. I don't know if Linkedin CSS takes over or what, but they just appear gigantic on the Email received. Just to clarify, I am resending Email using PHP mailer apart from the email sent by my boss thru Linkedin.

Sign in to reply to this post

Ray BorduinWebAssist

Your image has two style tags... the first one will be ignored:

<img style="width:50px; height=" autoalt="No alt text provided for this image" id="ember43" loading="lazy" src="https://media.licdn.com/dms/image/D4E12AQGP40Gx347Lyw/article-inline_image-shrink_1000_1488/0/1678714121121?e=1684368000&amp;v=beta&amp;t=F0KMkmsp7r3agMZQN_Yp8u2XJPX37h78ZeZPcdtNbGU" style="height: 375px; width: 500px;">

This is the one that would be active:
style="height: 375px; width: 500px;"

Remove that and your other style tag should work.

Sign in to reply to this post
Did this help? Tips are appreciated...

lr_leal239405

Still comes in gigantic. Didn't realize I had it 2x on this last test but here's the new code inspect from the email. It shows up probably over 1000px wide getting past the screen scrolling to the right.

<figure><a href="https://www.mywebsite.com/products/ap.php" rel="noopener noreferrer" target="_blank"><img alt="No alt text provided for this image" id="ember43" loading="lazy" src="https://media.licdn.com/dms/image/D4E12AQGP40Gx347Lyw/article-inline_image-shrink_1000_1488/0/1678714121121?e=1684368000&amp;v=beta&amp;t=F0KMkmsp7r3agMZQN_Yp8u2XJPX37h78ZeZPcdtNbGU" style="height: 75px; width: 100px;"></a></figure>

It's totally ignoring that 'style='.

Sign in to reply to this post

Ray BorduinWebAssist

Try moving the style tag to the front of the tag in case something before it is causing issues. I'd remove the loading="lazy" part. That won't work in an email body. Then send me the resulting email and I'll take a look.

Sign in to reply to this post
Did this help? Tips are appreciated...

lr_leal239405

I forwarded it to your email. From the 2nd pict on, they are the ones pulling from Linkedin. I think I left the loading='lazy' on one accidentally, nonetheless they all come in big, except the one pulling in from our website.

Sign in to reply to this post

lr_leal239405

Also. I would like the Webassist email to authenticate and put in the Sent box. I have code that will do that when using phpmailer (without using Webassist code), but it won't read the PHP code so I get some php code in the email.

Sign in to reply to this post

lr_leal239405

never mind the file_get_contents question for the layout. I used:

ob_start();
include '../webassist/email/templates/newsletter.php';
$mail->Body = ob_get_clean();

and it lays out the newsletter ok (although it introduces other issues. But I got a step further).

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...