Is there any way to set a header in an html email within the body of the email? - html-email

I have a client who needs some html mass emails sent. I've coded the email, but for some reason, probably a problem with their mail client, the test emails they've received have been marked with low importance.
I believe I could override this by adding an x-priority header to the email, however the mass mail service I'm forced to use (have no choice about this unfortunately) won't allow me to customize headers.
Is it possible to set the header within the actual body of the email? Are there html tags that allow for this?

No. Email HTML is just markup, and clients don't read the content for headers.
Which client are they using? Some clients (Hotmail, Gmail) analyse the content and assign their own rule, so there is no header you can change. This is done at the mailserver level, so if a user's client is, say, Thunderbird but their server is Gmail, it may still mark as low priority based on Gmail's rules.
If the client is Outlook and the mailserver is an in-house Postfix installation (for example), then you can set X Headers but by default, Outlook will strip them. For this reason, I suspect either the server or the client is setting the priority, it's not at the send level.
Look at the original source, and see whether or not it does contain the Priority header.

Related

Email open tracking

I have to create email tracking system, but the problem is that when the sender opens an email this is counted as an opening by the recipient.
When I send an email through Polymail (or some other tools for tracking emails), then in the 'sent' folder I have an email without a tracking pixel, but the recipients of this email have the pixel and at the same time everyone have different code inside (I think, to determine which of the recipients opened the email).
How is this possible? The sender and the recipients have different contents of the same email. Can this be implemented using smtp / imap / gmail-api?
For standard IMAP/SMTP setups (specifically: not GMail), the message is submitted twice, once to SMTP to be sent, and again to IMAP to be placed in the Sent mailbox.
There is no requirement that these be the same: in fact, in normal use, the BCC header, for example, is submitted to IMAP, but not SMTP.
GMail, and a few others, while trying to be helpful and save bandwidth, do the copy automatically, but make it impossible to supply different versions. (Unless you want to try to find the duplicates and delete them out of band).
Current Email protocols don't send any kind of ACK to the Sender when mail is opened. So you need to put some kind of analytic tool inside the mail contents to keep the track of it.
Some suggested methods and widely used tool is Bananatag.
Alternatively, you can use custom Google Analytics for the same. Refer here https://dyn.com/blog/tracking-email-opens-via-google-analytics/

How to know if email spoofing is successful?

Just for knowledge purposes, I want to know if it is possible to know if email spoofing has been done successful or not . Suppose if I am sending an email from one's account, What if receiver doesn't exist? Means will i get any error as a spoofer that receiver doesn't exist and you cant send email . Thanks
There is no way to know for certain, but you can make an educated guess.
First, when sending an email to a non-existent recipient and the recipient's server is configured to report this to the sender (pretty much the default behaviour), this reporting can happen either:
1) During the email transmission. The SMTP conversation with the recipient's server may very well fail at RCPT TO: (i.e. when the recipient is specified) or at the end of the DATA or BDAT commands (i.e. when the email just have been transmitted and the server either acknowledges this or rejects the email). If you receive an 5xx-type response at either stages, or, well, anytime earlier in the conversation, you can be sure the recipient did not get the message. Validation during email transmission is common.
2) After the email transmission. Servers that don't do recipient validation on SMTP level will often accept and queue emails during the transmission, then generate a bounce report (also called a Delivery Status Notification/DSN or Non-Delivery Report/NDR) later and attempt to return it to the original message sender. As you have no access to the mailbox of the original message sender when spoofing, you will have no idea if such bounce report is generated. This method of validation is still fairly common.
Second, you can embed a tracking image in your HTML email to see if the email was opened. This works by placing a HTML <IMG> element in the email that points to e.g. http://example.org/tracking-1x1.gif?uuid=<id>. The idea is that you track whether that image was downloaded. Be aware that virtually all modern email clients will disable downloading images from unknown sources and some action is required from the recipient to enable downloading images.
Third, you can spoof the MIME sender only. Emails have two distinct set of addressee information: the envelope addressees and the MIME addressees. Emails are delivered based on what's written on the envelope, but email clients render the MIME information instead (what's inside the envelope). In other words, during the SMTP transmission you may specify a different sender address (MAIL FROM: command) from that in the email (From: header). The fun part is that bounce reports are sent to the envelope sender address, a.k.a. the Return-Path, so if you have access to the envelope sender mailbox, you can receive a bounce report no matter what stage it was rejected. Note that you will reveal yourself, either through the mail server logs or through the email header, where the Return-Path header will contain the envelope sender address.
Please use the above information for "knowledge purposes" only. Be aware that email spoofing is likely a crime in just about any country.

Is it possible to modify "from" field in mailto link?

I'm trying to get a mailto link that would open a new outlook email window with a modified from field (i.e. to use a secondary account as it were). Is that possible?
No. Certainly not in most of the popular mail clients.
I assume you are wanting to do this just to save time in your own mail client. I would certainly be annoyed with a website that tried to change my from or reply-to address, so I'd expect my mail client to ignore it.
MAILTO is designed to facilitate a sender contacting an address that has been listed on a website. So there are very few things that the sender would expect to have dictated by the website. Even the standard options can be pretty annoying if handled badly by the website owner.
Your options are pretty much limited to
subject
body
cc
bcc
Even if a client were to support From (and I am not aware of any that do), there is no obvious way for them to handle edge-case scenarios such as a from address that has not been configured in the mail client.
What do you need this for? Perhaps you can use a script to send mails and dynamically set the From header. For example, PHP has a mail() function which would allow you to set a custom From address (and modify other headers).

unable to deliver a pdf attachment to clients

On our website which is asp.net, we make a sale and an automated email is sent out to the client with an attached PDF invoice we create using a 3rd party app. We are having trouble getting these delivered successfully to some corporate clients. Yet we also send a copy of that same email to ourselves which we receive fine. We can then forward this on to the client and they do receive it no problems. So the original is not received but the forwarded mail is.
The webserver is a seperate IP address to our office Exchange server which sends the forwarded mail.
I have tried to find the difference between the 2 mails and it looked like a rich text issue, except that the mail is plain text or html!
The question is a little vague i know as i do not know where to look for the best. It seems to make no differenec which mail program is used, we tried MailEable and it was the same thing.
Mail is logged on the web server as leaving and that is the last we see of it. It doesnt bounce but it is definatley delivered to the client server, but doesnt reach the recipient. We used to track thru Message Labs and it would say it had reached the destination server ok. We do not use ML anymore until we find the issue, keeping it simple.
We have no issues sending to AOL, Hotmail and Yahoo etc.
It appears something in the email is upsetting server based spam software.
We havnt been able to get hold of any email logs from clients.
any suggestions?
Check out this link mentioning a reason not related to size issues
The SMTP (internet mail protocol) RFC (An RFC is a document describing
the standards that make the Internet work.) explicitly states that the
length of a single unterminated line can be 1000 bytes, no larger.
Some SMTP servers violate this, and the Firebox (this is our firewall)
will drop the connection when the line length exceeds the configured
length, which defaults to 1000.
which might indicate your pdf generator and/or mail generator creates output that's not 100% standards compliant. Might be a good point to check as it could explain why certain customer suffer fom this problem only.
552 Requested mail action aborted: exceeded storage allocation
This means there was a violation at the client's ("customer's") mail server. The message exceeded a threshold/limit of some kind. It's not clear if this is a per-message limit or if the user's mailbox is just so full that it cannot accept another message.
Either way, this is mostly out of your control. Only thing you can do it try to keep your e-mail messages and attachments as small as possible. If you can, compress (zip) any attachments before sending.

Adding urgent priority to mail set from mailto link

I want to add a mailto link on our web page. I want to add a urgent priority to this mail.
mailto links just doesn't support this feature , sorry.
however, you could use a specific subject and filter it in your inbox
Send a email
You can get your priority, but probably not that way.
Most mail clients honor subject= and body= in the query string of a mailto: link. Some mail clients treat multiple body= attributes as different lines; others only use the last body. Getting to your point, though: I don't think most clients will let you set priority, and it only takes one client that won't do it to make your system unreliable.
The easiest approach is to use mail filters to set priority on inbound mail. The filters should set the priority based on the subject lines, which you can reliably control.
If your mail system's filters can't set priority, try sorting to different mail folders.
You can't do this with a mailto: link, but you could create a server-side contact form that sends the e-mail out with the proper headers.
I guess if such a feature exist it's browser-specific.
from w3's website:
User agents may support MAILTO URL
extensions that are not yet Internet
standards (e.g., appending subject
information to a URL with the syntax
"?Subject=my%20subject" where any
space characters are replaced by
"%20"). Some user agents also support
"?Cc=email-address".
It can't be done.