Sendmail: linking to an image
I don't use sendmail a lot, and I can't quite remember how to make this work right. I'm trying to send an email to an admin when a user submits a form, and I want to link to an image if they submitted one.
++++++++++++++
list of top cheapest host http://Listfreetop.pw
Top 200 best traffic exchange sites http://Listfreetop.pw/surf
free link exchange sites list http://Listfreetop.pw/links
list of top ptc sites
list of top ptp sites
Listfreetop.pw
Listfreetop.pw
+++++++++++++++
But in Outlook, the link is removing the first 2 characters of the link. So when I send:
<img src="https://www.example.com/image.jpg">
Outlook is getting:
<img src=ttps://www.example.com/image.jpg">
But it works fine in Thunderbird.
I'm coding in Perl, but I put it here because I think it's really a sendmail question:
# set $mailprog, $username, $subject, and $boundary
$img = "<img src='https://www.example.com/$pic'>";
open(MAIL,"|$mailprog -t");
print MAIL <<EOF;
To: admin\@example.com
From: $username
Subject: $subject
MIME-Version: 1.0
Content-Type: multipart/alternative;
boundary="$boundary"
This is a multi-part message in MIME format.
--$boundary
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
(blah blah blah)
--$boundary
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML//EN">
fullonsurf.com
host havoc login
traffichoopla.com
fit2gym.com
i host poker
make money hand over fist
tgmi3a.com
redrocketsurf.com
buxcap.com
<font face=Arial>
(blah blah blah)
$img
</font>
--$boundary--
EOF
close MAIL;
I have the same problem if I change the <img src...> tag to <a href...>. The problem is always following the =.
What's the correct way to code this?
perhaps outlook is trying to remove images and it gets munged in the process.
you might try embedding a base64 encoded image in the body of the email and modify the src to appropriately refer to that image.
this is merely a shot in the dark, but try using the qq quoting operator and double quotes for the attribute value to see if that fixes anything:
$img = qq(<img src="https://www.example.com/$pic">);
Well, it looks like the problem is any link, not just an image link :-( The <a href...> link is messing up, too. So this:
<a href="https://www.example.com/view.php?id=csdude">https://www.example.com/view.php?id=csdude</a>
becomes:
<a href=ttps://www.example.com/view.php?id=dude">https://www.example.com/view.php?id=dude</a>
(removing the next 2 digits after both equal signs)
The code I'm using here, based on your suggestion with qq():
use URI::Escape;
$uri_user = uri_escape($username);
$link = qq($home/view.php?id=$uri_user);
Just for ### and giggles: What happens if you sneak in a couple of extra spaces--or, I guess, a couple of non-space characters--between the = sign and the "http ? (And, I guess, slip in two bogus leading characters at the front of each parameter value.)
Something is niggling at the edge of my mind and I'm trying to lure it in closer.
Well, it looks like the problem is any link, not just an image link :-( The <a href...> link is messing up,
indeed i forgot you had mentioned that.
Just for ### and giggles: What happens if you sneak in a couple of extra spaces--or, I guess, a couple of non-space characters--between the = sign and the "http ? (And, I guess, slip in two bogus leading characters at the front of each parameter value.)
Well, then it would break on my Thunderbird! LOL And it currently seems to work fine on both iPhone and Android's email, so I guess that adding characters would make it break on those, too.
This seems to only be a problem for Outlook, but I can't find any reference to it anywhere else. The admin is specifically using Outlook 2007, if that helps?
Wait, I think I found it! The problem is here:
Content-Transfer-Encoding: quoted-printable
QP works by using the equals sign = as an escape character... an ASCII equal sign (decimal value 61) must be represented by =3D
[en.wikipedia.org...]
So it looks like changing all of the = to =3D should work (in theory, I haven't tested it). What's the preferred Content-Transfer-Encoding for email, though, if not "quoted-printable"?
i thought it might be related to encoding - still don't understand why it would try to decode something that wasn't hexadecimal digits.