Help - Search - Members - Calendar
Full Version: can't get image to show up in gmail
HTMLHelp Forums > Web Authoring > Markup (HTML, XHTML, XML)
farmerDan
Hi, I am trying to send a email created in a bash shell script using curl, json, and html that will contain a gif logo. I was able to successfully send images (gif, png, jpg) as long as I used "C:\\\filename" from a Windows computer to Outlook. If I try to exec the same bash script and send to my gmail acct, the pics do not appear, just a little image box that does not expand even if I select Download Pic.
I am able to attach a gif to an email, and send it to my gmail acct from Outlook, and that works fine.
Just not sure what I am doing wrong in the shell script or what I need to change to make it work for all email providers.
I am using sendGrid to send the email.
The last part of my shell script:
"content": [{"type": "text/html", "value": "
<!DOCTYPE html>
<style>{font-family: Verdana,sans-serif !important;}
</style>
<body>
<p>Hi there,</b>
<p>Sincerely,
<br>Dan
<p>
<img src='HT2.gif' alt='mygif' style='display: block'>
<p>
<img src='file:///home/dan/HT2.gif' alt='dangif' width='500' height='300'>
</body>
</html>"}]}
EOF

Any help would be greatly appreciated. Thank you.
CharlesEF
If I understand correctly, Email you send to someone else can't get images from your personal computer. The image should reside somewhere on the web and the img src attribute should point to that web address.
Christian J
QUOTE(CharlesEF @ Jul 18 2024, 09:03 AM) *

The image should reside somewhere on the web and the img src attribute should point to that web address.

Some users may block such images though, so make sure the email is functional even without the image.

Another options is to embed the image in the email as Base64 data: https://www.geeksforgeeks.org/how-to-displa...images-in-html/
farmerDan
QUOTE(Christian J @ Jul 18 2024, 06:07 AM) *

QUOTE(CharlesEF @ Jul 18 2024, 09:03 AM) *

The image should reside somewhere on the web and the img src attribute should point to that web address.

Some users may block such images though, so make sure the email is functional even without the image.

Another options is to embed the image in the email as Base64 data: https://www.geeksforgeeks.org/how-to-displa...images-in-html/

i will try the base64 technique. thanks for the response.
farmerDan
QUOTE(CharlesEF @ Jul 18 2024, 02:03 AM) *

If I understand correctly, Email you send to someone else can't get images from your personal computer. The image should reside somewhere on the web and the img src attribute should point to that web address.

Not really sure where I would put the image on the web, but I did get an image to display by doing just what you said. I just picked some random pic (think it was a light bulb), and used the URL and it did display. The rest of the email is being generated correctly and does display. thanks.
coothead
Hi there farmerDan,

Do you not know how to Convert your HT2.gif image to Base64 format?

coothead
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2025 Invision Power Services, Inc.