Mailkit and search in html Mail on IMAP - mailkit

I search with powershell in my IMAP directory for mails that have a certain text module.
Unfortunately, this only works with text / plain mails.
However, if the mail consists of HTML (text / html), nothing is found.
Are there options for SearchQuery that text can also be found in HTML mails?
My search string:
$suchen1 = [MailKit.Search.SearchQuery]::FromContains ($mail_From).And([MailKit.Search.SearchQuery]::SubjectContains($mail_Subject)).And([MailKit.Search.SearchQuery]::DeliveredOn($today)).And([MailKit.Search.SearchQuery]::MessageContains($mail_Message))

MailKit doesn’t do client-side searches for IMAP. Instead, it sends your search query to the server and just gives you the match results that the IMAP server returns.
There is also no HTML-aware IMAP search query mechanism, so you are out of luck.

Related

How to extract the email from email body using applescript?

I want to get the email address that i mention in the image.The email i received from my clients and i am using applescripting and
i want to use that email as recipient.I will send auto mail to this email address.
Thank You.
The concrete solution depends strongly on the HTML text.
You got two options:
Get the source of the message, extract the HTML part, use an HTML parser to get the address or convert the HTML text to plain text with textutil.
Get the content of the message – which is plain text – check all paragraphs for email parts and use regex or sed or text item delimiters to extract the address.

How to set email format plain text using mailto function

i am read a email using Web-methods services and facing problem, Web-methods reading HTML format email as a plain text and giving us HTML. so, i like to set content type as plain text through mail-to function. and i am using this syntax but not working:
mailto:xxxxxxx#sapient.com?Content-type=text/plain"
problem solved, solution: we can add a property on exchange server for particular email id that this email id will get email in text/plain form only. so now i am sending a HTML email then exchange server convert it as a plain text email.

Extract Email Address from Nested Tables in HTML Emails

I will be receiving approx 500 emails over the next day or so. The emails are all identical in layout i.e. HTML emails that display information inside a table. There are nested tables within the email.
I need to extract the email address from each email and store it in a file (text/csv). Rather than "copy & paste", is there a php script or some browser plugin I can use to do this?
GF
I will use php parse by id,class or name and a little script to go throw all the pages inside that folder to extract it as a csv I'll use fputcsv.
Hope it helped.

How to send form contents anonymously via email

How do you send the content of a website form to an email address without disclosing the email address to the user.
Thanks!
PS: If at all possible, I would like this to be in HTML JavaScript Ok, anything I guess.
Not possible. You can however put a "fake" from header in the mail. You'll only risk it to end up in the junk folder.
HTML doesn't provide any functionality to send mails. You'll really need to do this in the server side. How exactly to do this depends on the server side programming language in question. In PHP for example, you have the mail() function. In Java you have the JavaMail API. And so on.
Regardless of the language used, you'll need a SMTP server as well. It's the one responsible for actually sending the mail. You can use the one from your ISP or a public email provider (Gmail, Yahoo, etc), but you'll be forced to use your account name in the from header. You can also register a domain with a mailbox and just register something like noreply#example.com and use this to send mails from.
Update: JavaScript can't send mails as well. Like HTML it's a client side language. You'll need to do it with a server side language. All JavaScript can do is to dump the entire page content back to the server side. jQuery may be useful in this:
$.post('/your-server-side-script-url', { body: $('body').html(); });
with (PHP targeted example)
$to = 'to#example.com';
$subject = 'Page contents';
$body = $_POST['body']
$headers = prepare_mail_headers();
mail($to, $subject, $body, $headers);
Update 2: if you actually want to hide the to header in the mail, then you'll need to use the bcc (Blind Carbon Copy) instead. This way the recipient addres(ses) will be undisclosed. Only the from, to, cc stays visible.
If you mean doing so on a client side, using mailto: link - you can not.
If you mean any way, yes - you submit the form contents back to your server, and have your back end script send the email.
You can do the form in HTML, but the posting will need to be done in a script. Even if you don't expose the email address, the script can be used to spam that email address. This is why you see captcha being used in such cases.
There are scripts available for most languages. Check to make sure their are no known security problems for the scripts. The original Matt's script in perl had problems, and the Perl community created a more secure version.

Some email recipients get messages with =0D or =3D characters

I have a LAMP web application that emails users. Some users have complained that instead of seeing html email messages, they see weird sequences of characters such as =0D or =3D. I can't reproduce this bug with any of my email clients : gmail, yahoo mail, hotmail, thunderbird, blackberry or iphone. Does anyone know what's going on and how to fix this?
This is called quoted printable encoding. Some system that handles the mail while it is being delivered to the recipients that are seeing the offending characters messes up the encoding or the header information about the encoding.
Check whether the encoding you are setting when sending the mail matches what you are writing to the mail and whether that is also what is received by other people.
When you see something like =3D, what you're seeing is a single character in what's called "quoted-printable" encoding. "=3D" is, in fact, an equal sign. =0D is a Carriage Return (CR), =0A is a Line Feed (LF)
Taken from Not all 'plain-text' is created equal...
The link will provide an in-depth detailed description as to what is going on.