How to correctly embed image in html email - php

I have some trouble to correctly embed images in html/php email.
My .php file just sends out a few text emails. But I want a picture in there.
<img src="http://website/image.jpg"> works so far but outlook blocks the image and I have to click download images every time.
So I found out that this is the behaviour of linked images. What I need is an embeded image.
<img src="image.jpg"> seems easy but does not work. The image is in the root directory of the index.php but the Mail does not contain the image. Just an error appears: "image cant be displayed".
I swear I googled for 2 hours now. How do the companies do that with their signature.
I appreciate your help.

I've done the company signature couple days ago and found a lot of problems.
For instance, you can set background-image and gmail and most of the email managers will display it, but outlook will not.
For images isn't the same.
Outlook will display your image, usually when it's https://...
In my case I was using firebase hosting to locate the images and 0 problems with that.
<img data-imagetype="External" src="https://firebasestorage.googleapis.com/..." class="x_gmail-CToWUd">
I use this signature in gmail, and outlook is displaying that <img> tag without any problems, and no need to make any attachment.
The data-imagetype is added from outlook when receiving the email and the class x_gmail... too.
Hope this will help you, if not I'll try to find a better solution for you.

Most email clients block images as a default. It’s up to the user or administrator to overcome this behavior. You can’t override it in email.

Related

Laravel : Incorrect embedded image in blade

sorry for the question, but I have an mailing system from a Laravel app that sends a newsletter in HTML format with images on it. I tested by placing the html in blade and embedding the images like this:
<?php $message->embed(storage_path().'/images/unnamed.jpg'); ?>
Because if I just referenced the location of the image when the html is sent to mail all I'm getting are broken images. However, when I embed the images the mail is incorrect because the images are in different places instead of where they should be. What is the correct way of doing this? Instead of embedding the image should I store it on a cloud storage and just reference it from the html?
Please help, appreciate any advice, solution, or pointers. Thank you very much.
Here is the sample email:
You're getting broken images because it's an external (internet) link to the image. There is no proper way of embedding an image. Every external request is a potential danger and it's block by default by mailing/anti-virus program. The only way to show a picture is to ebed an image directly into HTML. here's an example:
http://www.techerator.com/2011/12/how-to-embed-images-directly-into-your-html/

Wicked PDF not rendering remote image from php source

I have a php site that serves image content based on query parameters. I'm trying to embed that image into a wicked_pdf and am just getting a little box with the alt name. I've done the troubleshooting by showing in html and the image renders properly with the tag
<img alt="Doorsjpg" src="http://config2/doorsjpg.php?lineup=BR111">
I've tried it with both image_tag and wicked_pdg_image_tag and the results are the same either way.
This wound up being a DNS issue, apparently. Changing "config2" in the url to the IP address resolved it. Couldn't tell you why it worked in HTML mode if it was DNS but it's been that kind of programming day already and I no longer question these things.

Gmail image proxy

I'm sending out html emails. One of the png images is not showing up. When I click on the proxy link I get a 404 error, but the actual image exists and can be publicly clicked on. This works fine on my dev server too. Any ideas as to what could be causing this?
I've heard reports that having the same image in multiple places can be the cause of this error with the Google proxy. Save your image as a different names and it should show. Silly that you'd want to load 2 images instead of one, but I believe that is the only workaround currently.

Is it possible to send image to email using CKeditor

I've been creating a page where I can send some info with an image to a yahoo account. I'm using CKeditor and php mail. Is there a way to do it? Actually I've tried it and it works good but the image is blank only the border size of the image is visible. Thanks
Assuming that you are not embedding the images to the email, most likely your URL is wrong. Try post-processing the URLs to be absolute and not relative and that will fix your problem.

Send email as html with embedded images as background

I am trying to send email as html with embedded images (not attachment) and as background.
I was trying to use Xpert Mailer but their documantion has small amount of information so I didnt succeed.
I was also trying to use Swiftmailer, with Swiftmailer I succeed to send email with embedded images but not as background.
Anyone has any clue how to send embbed images as background / has good PHP Email Sender?
Thanks!
Don't know about the apps you're using but this can be done by embedding the images in base64 format, looks like this:
<img src="data:image/gif;base64,R0lGODlhUAABLABLAMOREBASE64HERE">
Quick google search shows the following converter site: click
I found the answer. the problem was not my html or how I embedded the image. tha problem was that gmail doesnt support css property background / background-image and therefore it didnt work for me.
I had to use

Categories