Accept outlook meeting invite with HTML body in reply (using exchange webservices) - vb.net

I've written a service that queries an exchange mailbox using exchange webservices to schedule video conference meetings. the idea of this service is to accept meeting invites, query a SQL database for available dial in details out of a pool of details, it then writes these dial in details as HTML body into the accepted email.
This works great when the email account that the invite was sent from is on the same exchange server.
when however the invite comes from an external participant then the accepted mail body only comes through as plain text.
here is my code (for testing I have made the body very simple)
Dim accept As AcceptMeetingInvitationMessage = appoint.CreateAcceptMessage(False)
accept.Body = New MessageBody(BodyType.HTML, "<html><head></head><body><span style=""color:red"">This should be red text</span></body></html>")
accept.Send()
this works internally and the text comes out red, externally however it does not.
UPDATE:
I might have already found the issue, the global message formatting setting on our exchange server for all external domains was set to follow Outlook client settings.
So since my app isn't using outlook to reply to messages the Exchange server formats it as Rich Text which the external mail client does not understand.
will update again on Monday as we need to restart the Exchange transport service for the change to take.
info found here: https://www.codetwo.com/kb/how-to-configure-exchange-server-2000-2003-to-send-rtf-messages-in-html-format/
and here: http://support.risualblogs.com/blog/2011/02/24/html-mails-sent-via-owa-and-outlook-2011-are-received-as-plain-text-mails-externally/

Ok so I found the answer, changing the rich text formatting did not fix the issue. I then ran a powershell command on exchange to force the format to MimeHTML.
this fixed my problem. I think it was a combination of both settings.
info can be found here:
https://www.codetwo.com/kb/forcing-message-formats-in-exchange-2007-2010/

Related

Email Deliverability - Wrong Email in From section

I recently started working in hosting/software firm. And currently we have problem with our DNS server.
Two days ago we started getting complaints from our clients that they are receiving emails but in the From section there is a mistake, it shows wrong email of a sender. The email address that's displayed is a random address from one of our clients.
After trying to solve this problem i realized that in Email Deliverability section in cPanel Problems Exist (DKIM, SPF, and Reverse DNS).
When clicked on manage it shows how the records should look and it says that I need to update them, the problem is those same inputs do exist and so the problem persists.
It's important to note that this is a shared hosting server.
Is this some form of hacker attack? Did anyone ever had the same problem?
The sender email address is always specified by the mail client used to send that email (it's common to make mistakes in mail client settings). If those emails are not really sent by your team/server, it could be spoofing. You can implement SPF/DKIM + DMARC in your domain so that recipients can reject spoofed messages whenever they're not coming from your server.
Turns off the problem was coming from a different IP address. We were being attacked. As soon as we blocked it it stopped, and that error cPanel was showing was because the configuration on our server, it was always there.
This was the problem. I advise all WHM/cPanel users to update ASAP because the problem is really hard to find once you get in the middle of it.
https://www.tenable.com/blog/cve-2019-10149-critical-remote-command-execution-vulnerability-discovered-in-exim
You can monitor your email health score with a mail testing service.
These services allow you to check for deliverability issues along with spam activity on your email. Warmup Inbox provides a health score to all users. It's nice to keep track of how your email is performing/what needs to be improved.
Implementing a SPF record alongside proper DMARC and DKIM settings for your domain will drastically increase the overall deliverability rates of all outgoing mail coming from your domain. DKIM and DMARC increase deliverability rating as well as keep your mail server safe from malicious attacks and damaging spam mail.

Send email to pushbullet?

The website "PushBullet.com" is webwashed(filtered) by our proxy, at work.
But I really need to send some notifications to my devices.
Is there a way to send them thru the good old email protocol ?
So there is no officially supported feature for this, but you can sort of fake it using the existing email-to-push feature.
Send a push to an email address that is not a pushbullet account, such as yourgmailaccount+randomstring#gmail.com. It will have a from address of someotherrandomstring#pushbulletuseremail.com.
You can then send emails to that address, and they should show up in your pushes list.
Proposed method with random strings in email address doesn't work.
This method works. Not an email, just pure notification as required.
The library developer suggests also command line notification send. Simple and handy.
I was looking to do something similar so I could get pushbullet notifications from cron jobs, and came across this:
https://github.com/side2k/email2pb
I haven't gotten a chance to try it yet but I think this will do what you're wanting. Just tested it, and it works really well if you're able to run a postfix server.
I use Zapier for this (you can do it with a free account).
Set up a Zap to search for new mail under a label (I use "pushbullet-notify"), and send any message there to Pushbullet.
Then in Gmail just create filters for any mails you want PB notifications on, applying the same label.
The notification may be delayed up to 15 minutes from the time the email is received and labeled (free accounts check every 15 minutes).

How to retrieve only new emails using POP3 protocol

I am using POP3 protocol to retrieve my emails in my .NET application. I need to read just new emails only but found in many blogs that it is not possible to retrieve just "unseen" or "new" mails using POP3. Is that true? If so, could you please help me understand how Outlook Express manages to get new mails using POP3?
Is there any way that I can flag the seen mails in the email server itself? Or please help me find out a way to retrieve new mails using POP3 protocol.
You have to store the UIDL of each email in a local database. When you want to check for new mail, you retrieve the UIDLs on the server and see if you have if already in your local database; if not, it's a new mail.
Outlook uses the same strategy, BTW (see this KB article).
As long as your mailbox doesn't keep a copy of the emails on the server then you are fine and don't have to code for this.
Normally when an email client access the emails from a POP3 box they are downloaded and removed from the server.
Exchange is a different thing entirely.
Cheers

Can Outlook Interop API not recognise a DeliveryNotification

Story goes: My user sends an email to their client. My user ticks of "delivery notification" / "read notification". The client responds on the notification. Now my user has a "notification" sitting in their inbox. My application may attach that "email" to a project database, happens with any other regular email.
Now a bug report ticks in (feature request) on my table. My user like to attach those "notifications" to the project in question, but my application does not recognise the notification as an email.
Having recieved this feature/bug request, I start investigating. When I right click the mail in question I'd expect to have the option of attaching the mail to a project. I do with regular emails, but not with the notification email.
First off: Isn't a delivery/ read notification just like any other email. Apparently not as it is not being recognised in the first run.
Second: If it isn't an email, what is it then. Apparently it does not exist. WT'bip'...
I found an enum DeliveryNotificationOptions under System.Net.Mail, but I'm using the Microsoft.Office.Interop.Outlook and the MailItem in there. I found the MailItem.OriginatorDeliveryReportRequested which is what the client's mail application has replied to and sent my user the notification.
I have the Outlook addin both as an Office2007(.Net3.5) and Office2010(.Net4) version, the 2003 has been retired. The way I see this it goes beyond office and .net version concerns.
Any light or pointers people like to share on this matter would be appreciated.
It's called a ReportItem (DeliveryNotification).

How To read Emails in vb.net 2005

How can I read Emails in vb.net 2005 (without Using Third Party Control). Please Any idea and source code Give to me.(Any Method)
First of all there are multiple protocols to retreive mail:
POP3, IMAP, etc...
I suggest you start by familiarizing yourself with the various
components that make up an e-mail system.
Mail Transfer Agent (Protocol: SMTP)
Mail Delivery Agent (Protocols: POP3, IMAP)
Mail User Agent (Outlook, Webmail, Thunderbird, your application)
Basically what you are trying to write is a Mail User Agent.
A mail user agent has to "fetch" the mails from a Mail Delivery Agent using
either POP or IMAP.
This means you will have to learn about these two protocols:
POP3 RFC: http://www.faqs.org/rfcs/rfc1939.html
IMAPv4 RFC: http://james.apache.org/server/rfclist/imap4/rfc2060.txt
Since e-mail communication happens using TCP/IP you will have to learn
how to use the classes in the System.Net.Sockets namespace.
Take a look at the TcpClient class: http://james.apache.org/server/rfclist/imap4/rfc2060.txt
Try to understand these concepts first and then I suggest you start out with POP3,
this protocol is quite easy. If you have problems then with very specific TcpClient code please update your question or post a new question.
Hope this sets you on the right track.
Assuming you want to connect to POP mailbox and download emails, I'm afraid it's not all that straightforward to do in VB.NET.
There is an extensive article on CodeProject but it looks like a fairly advanced.