could hyperlinks in emails be getting changed by the destination mail server - email

We send out password-reset emails to business partners who use our intranet. The body of the email contains a hyperlink:
`http://www.ourdomain.com/ResetPassword.aspx?token=....`
But some of the people who receive these emails are saying there's an extra dot in the domain name:
`http://www.ourdomain..com/ResetPassword.aspx?token=....`
I do not see where that could be happening in the program I've written. I store the base url in the web.config:
`http://www.ourdomain.com`
and attach the name of the aspx page and append the token to it.
Are there any corporate anti-virus programs out there which deliberately mangle hyperlinks discovered in the body of emails, to render them invalid and thus unclickable?

This seems to be per the spec of quoted-printable encoding. It just so happens that the length of text in the message breaks to a new line right at the .com (72 characters maybe?). Please verify that this is the case by sending yourself a message and analyzing the quoted-printable source of the message.
System.Net.Mail creating invalid emails and eml files? Inserting extra dots in host names
The solution would be to not use quoted-printable encoding if some email programs cannot correctly interpret the spec.
plainText.TransferEncoding = System.Net.Mime.TransferEncoding.SevenBit;
//or base64

Related

Test email rendering - HTML raw source or HTML pre send?

I am testing some HTML email layout, I am not sure to understand which is the HTML I should consider:
use the HTML as it is sent from my server to mailgun (an email service provider)?
use the HTML as I receive it in raw format in the email I receive?
The difference is that in the raw source I receive there are =3D and =20 characters because of the quoted printable format. I'm using testi# but I suppose any rendering software will do, just it's not clear which version of the HTML should be used (needless to say I see =20 everywhere if it's raw, whereas it's perfect if I use the "pure" HTML)
You should use the HTML as it is before being sent. I'm unsure of how testi# works but with other services such as Litmus & Email on Acid you can send a test to them directly from your ESP and they will process that for the previews.
[Added from comment on question to allow close]

How can I force Mailgun to send an e-mail using base64 encoding via API (php)?

I am sending an HTML e-mail via API whichi s UTF-8, however Mailgun seems to sometime use base64/UTF-8 and sometimes use quoted-printable ascii.
I am having a problem with Outlook 2013 (incorrectly I believe) re-writing the header of the HTML e-mail from UTF-8 to ascii and then not displaying my pound sign: £ as it doesn't exist in ascii.
I suspect this is happening in Outlook 2013 becuase the character encoding of the mime part is ascii and the e-mail is UTF-8. I believe the only way to get round this is to force Mailgun to send the e-mail using base64 mime encoding and UTF-8 but I don't know how to force that to happen using the API.
I am quite sure this is not the best solution but in case it helps anyone, I have simply added a pound sign which is styled white. I know it seems horrible, but I haven't found anything better and it seems to work!
<font style="font-size: 2px;" color="#ffffff" size="2">£</font>

Unexpected email - x-newtrunsreceiver header

Struggling to find any useful information on this, so I'm hoping some light may be shed here.
I received an email to which I don't appear to have been addressed.
It's a legitimate email to our organisation, however there appears to be no reason for it to be delivered to me. Digging through the headers DOES reveal my email address, in a header field x-newtrunsreceiver.
ie.
x-sender: sender#sendersemail
x-newtrunsreceiver: legitimaterecipient1#ourorg
x-newtrunsreceiver: myemail#ourorg
x-newtrunsreceiver: legitimaterecipient2#ourorg
The recipients legitimaterecipient1 and legitimaterecipient2 are in the To: and Cc: fields respectively.
I am kind of assuming I've been BCc'd, but can't find any info on what the x-newtrunsreceiver header field is / does.
Any help welcomed.
MIME headers have absolutely nothing to do with who actually receives the message.
When a message is submitted to an SMTP server, the recipients are specified in the "RCPT TO" SMTP command. The MIME headers that follow the DATA command can contain anything. The SMTP server can in theory take a look at the To and CC headers, but there is absolutely no requirement or reason to do that.
Now the receiving SMTP server can add an extra header (e.g. Apparently-To), but, again, it has no obligation to do that.

Resent headers in MIME email

I want to know more about the resent headers (resent-from, resent-to, resent-date etc) that get prepended to an email's header.
When do these headers get added? Do they get added by the server or the mail client program?
I need to write a Java program using JavaMail api to forward an email (without changing or parsing through it's original content). I would like the email to be redirected to the destination email address on arriving at the server for a specific recepient.
Any snippet where you have been able to forward / redirect a mime mail using the resent headers will be helpful.
Thank you
See section 3.6.6 of RFC 2822.
You should be able to use JavaMail to add these headers to a message. If the message was read from a folder on a mail server, you'll need to make a copy of the message first before you can change it. Use the MimeMessage copy constructor. You can then send it to whatever address you want, ignoring the addresses in the message, by using the Transport.send method that takes an array of addresses. If you need to preserve the original Message-ID (which may not be appropriate since you're modifying the message), you'll need to subclass MimeMessage and override the updateHeaders method.

Problems sending HTML mail with attachment on iPhone

I'm trying to send a JPG attachment with a formatted HTML message. Of course I'm using [picker setMessageBody:emailBody isHTML:YES];
The rest of the code is what it is supposed to be, according to various messages on forums.
What I observe: the contents of the resulting e-mail message depends on the configured e-mail account on your iPhone.
E.g.: for a Yahoo mail account, setting isHTML to YES never results in an HTML message, but setting it to NO does! Bug in Apple stuff?
But, for a GMail account, I've never succeeded to send an HTML mail, it is always received as plain text.
The JPG file is sometimes shown inline, sometimes as an attachment.
All I want: send a JPG file, and a message containing some line breaks. Does anybody have some proven code that does just that, working for all kinds of e-mail accounts?
Even if you set isHTML param to YES, your message body can be sent as plain/text if the message body can be represented as such. And attachments in plain/text messages are not always recognized correctly by some email clients (Outlook).
In my case adding a link in the message body helped. Formatting text as bold with HTML tags works too. Tricky!
Tested on iPod 1G 3.1.3.