Quantcast
Channel: Xojo Programming Forum - Latest topics
Viewing all articles
Browse latest Browse all 3780

Sending email with inline image with Xojo 2024r2 Desktop

$
0
0

I’m using Xojo 2024r2 Desktop, with components EmailMessage e SMTPSecureSocket.
I’m trying to send an email in html with an inline image. Reading the posts on the forum I’m trying to solve the problem. But without success.
I also attach a sample project ( Download )

I try to insert a base64 inline image into the HTML code when I send the EmailMessage with SMTPSecureSocket, but the image cannot be seen.

This is the source received via email:

Mime-Version: 1.0
Content-transfer-encoding: 8bit
Content-Type: multipart/alternative; boundary="cpyxa3yvte8v"
X-CMAE-Score: 0
X-CMAE-Analysis: v=2.4 cv=D/WMKeRj c=1 sm=1 tr=0 ts=6687d802 a=Z27dpK4bOWhRHOCpLmIrNQ==:117 a=Z27dpK4bOWhRHOCpLmIrNQ==:17 a=HpEJnUlJZJkA:10 a=5KLPUuaC_9wA:10 a=g8TUdU_LZmEA:10 a=4oh2u1aVau_54mSFC8MA:9 a=NLMQV5p5AAAA:8 a=V5I0dzQLXKsO3V3TnZcA:9 a=_W_S_7VecoQA:10 a=aWTw2_BOBUSB0_-UnHUG:22

--cpyxa3yvte8v
Content-type: text/plain;

Title 1 of my email
Paragraph in the body
This is a test email. Let's try inserting html code with bold and also a link.


--cpyxa3yvte8v
Content-type: text/html;

<!DOCTYPE html>
<html>
<head>
<title>Test email message with xojo</title>
<meta charset="utf-8">
</head>
<body>
<h1>Title 1 of my email</h1>
<p>Paragraph in the body</p>
<p>This is a test email. Let's try inserting html code with <strong>bold</strong> and also a <a href="https://xojo.com">link</a>.</p>
<p>
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAsTAAALEwEAmpwYAAABV0lEQVQ4jWNgQAPZ8zx1M+d5T8yY530lY57PFwgGsuf7TMiY462Drh4Ocid6sGfO95mWMd/7L5D+jxXP8/4DxFNCV4WyYWgG2rQPp0YM7L0XxRCgE6cTrxmOJ8P9jNfZUAy05GLWfN8EIPsWzDtZC3y1GUCBQ4TmK7lzPURBFgL5AXDx+d59QAHvqwT8eyNrvpcESHN9vT0LUNMGJPnLIAM+oYX0QyT+3dxZHjIgzcBAYwZqXoZm+CdUA+Z5d4EUp8/zSQdpzprjJY/Q7LMYi+s+oXgBqCgWPX3U19czAcNgPg4vXkYJRFCqy5zrYw/X/Z+BEV8UA73UywBKnuAUhjDkY+Y8LyuQZqDrZuBLlelz/bTAFoGSJ5rkT6Dpt/HGDjC/wF0KSpZAp+4hIRXuTptpzIoSWCBDQMkT2Ts4MtNEDM3IAJQ8QSkMFMJA+jMIQ9m9cD8jAQCwK8QMzT+fqQAAAABJRU5ErkJggg==" alt="img_inline" width="16" height="16">
</p>
</body>
</html>


--cpyxa3yvte8v--

The email source appears correct, but the image is not visible.
If I copy and paste the HTML part into a file and open it with the browser the image appears.

I also tried using the CID and attaching the image file trying to change the Source of the message object. If I do this I don’t know why but EmailMessage always changes the boundary, and therefore what I insert has a different boundary from that of the email.

--cpyxa3yvte8v
Content-Type: image/png; name="img_inline.png"
Content-Transfer-Encoding: base64
Content-ID: <part1.02080004.04000407@sample.com>
Content-Disposition: inline; filename="img_inline.png"

iVBORw0KGgoAAAANSUhEUgAAABAAAA........

Has anyone faced, and solved, the same problem with inline images?

Thanks,
Gabriel

8 posts - 3 participants

Read full topic


Viewing all articles
Browse latest Browse all 3780

Trending Articles