I'm using ActiveUp MailSystem for an automated mail retrieve and treatment program in C# at work.
In the GMail browser mail cliente, my colleagues use GMail stars to mark a specific mail as handled or to be handled by nother colleague (they all use the same account, but some take care of some subjects while others take care of other subjects, and starring gives them a visual aid into what's taken care off and what's addressed to them by a colleague.
Using the inbox.Fetch.MessageObjectPeekWithGMailExtensions(uid) i can get which messages are starred by looking at msg.HeaderFields["x-gm-labels"] and checking it contains \Starred, however:
1 - How can i find out which start it is set to?
2 - how can i set/change a star on a particular message?
Any help is fully appreciated
I believe the Starred label only indicates that the mail can be found on the Starred mailbox. Gmail uses different IMAP mailboxes for labels. MailSystem isn't fully compatible with Gmail's enhanced IMAP commands yet (doesn't support mail's threadID for example).
You can check if IMAP actually stores the type of star by issuing a command method to the IMAP4Client class, that brings the full message (through the BODY IMAP command), but unfortunately you will have to parse and figure out the meaning of each parameter.
Other solution as Max said is using the X-GM-RAW enhanced search command to check for mails starred with the desired star, in which case you will have to use Gmail's unique identifier to know which email has which star.
Google maps stars to imap \Flagged flag, so you can just manipulate and look for that. Eg, store flag \Flagged, and the message will become starred.
Related
I have a somewhat interesting phenomenon occurring in Outlook 2019: when we are using Exchange accounts and toggle off the "Use Cached Exchange Mode to download email to an Outlook data file" option, we are no longer able to get the e-mail addresses for recipients via the Microsoft.Office.Interop.Outlook.PropertyAccessor interface (using the MAPI property PR_SMTP_ADDRESS) from an e-mail, in which we entered the recipient e-mails using the suggested Outlook contact. (eg. when the address is entered it looks like this: 'John Smith'). When we observed the item using OutlookSpy, we noticed that the specific property's value says MAPI_E_NOT_FOUND or is not present at all. I also noticed that in these cases, Outlook puts the corresponding e-mail addresses in the BCC field, which we obviously can't access when viewing the e-mail in the recipient's inbox. Is there a way for us to get the addresses, or is there some kind of workaround for this problem?
No property is guaranteed to be present. If the property is missing, try to use Recipient.AddressEntry.GetExchangeUser().PrimarySmtpAddress (error and exceptions checks omitted).
i have bot made using c#. It has the feature of human off. We have integrated the solution provide by tompanna of human handoff where a agent can talk to single user at a time.Here the link of solution we used for human handoff https://github.com/tompaana/intermediator-bot-sample. Our bot is working fine and able to talk with agent with the help of this solution but major issue come when a user want to share image or any kind of attachments from user to agent or from agent to user. The bot show that image is send but user is not able to see it. Simpler case happen in the case of agent.
Image of agent while sending a attachment to user.
And also the image of user ,unable to see the image send by agent.
The sample which you are using for Human HandOff has not been updated over a year, so it gets difficult to be able to find solutions for supporting various features pertaining to the same. However, going through the sample issues, there has been a similar issue in which the sample does not support emojis, images or files to the receiving user. If a user sends any of the above mentioned features, the receiver will get a blank message as it supports only text messages.
Th tentative solution suggested by a user is to create a simple method extension to send image/file messages.You could go ahead and give it a try to see if it works for your case.
Hope this helps.
You need to edit the source code of the library to achieve what you are trying.
In this MessageRouter file , method RouteMessageIfSenderIsConnectedAsync , you can access message.Attachments , then pass it as a parameter to SendMessageAsync in line 432, then from SendMessageAsync in line 160 , you can pass it to CreateMessageActivity method and then in file ConnectorClientMessageBundle , you can access the attachment and attach it to messageActivity.
I am using a Gmail business account, say noreply#mycompany.com to send a daily email reports to a few of my clients whose email addresses are from different domains. I use C# to send my email to Gmail's SMTP server.
var receiver = new MailAddress("receiver#domain1.com");
var receiver = new MailAddress("receiver#domain2.com");
var receiver = new MailAddress("receiver#domain3.com");
After a while I found out I had to modify code every time a new customer demands email report. So I want to make a group and maintain that group. Gmail has a Add Group settings in your account's "Contacts" page so I used that to create a group named ReportGroup and added those people. And in the code, this lines throws exception:
var receiver = new MailAddress("ReportGroup");
saying The specified string is not in the form required for an e-mail address.
Well apparently this isn't a legit email address. Is there a way I can bypass this format check? Or is it doesn't make sense to do so?
In further attempts, I tried to name my group as reportgroup#mycompany.com. This time the email got sent without complain however the gmail server rejects the receiver, claiming that
50-5.1.1 The email account that you tried to reach does not exist. Please try
550-5.1.1 double-checking the recipient's email address for typos or
550-5.1.1 unnecessary spaces. Learn more at
550 5.1.1 https://support.google.com/mail/answer/6596 ai2si23882633pad.98 - gsmtp
So this isn't the way to go either. Could any one suggest a solution for me to allow someone non-programmer to maintain an receiver list to which my code sends report to?
Create an alias for your group, and then send email to that address. Then you can continue to maintain the group as you normally do.
As soon as possible I will start a bounty and award 150 (that's what I have) points for solution.
I am developing Outlook add in. When message is sent, add in processes the message, it removes the attachments and sends them through different transfer channel and puts the attachment download links in message body.
When using outlook with exchange server with "maximum send size" limit users can't even attach large files to message. Outlook displays a warning that imposes exchange limit.
To make it worse attachment is refused before any of attachment events are fired.
I need a way to bypass this behavior. Something that will allow users to add attachments of any size by using outlook paper clip button, or drag and drop. Or good direction I can work on.
Adding separate attach button is not an option.
Try to set the PR_MAX_SUBMIT_MESSAGE_SIZE MAPI property (DASL name http://schemas.microsoft.com/mapi/proptag/0x666D0003) using Store.PropertyAccessor.SetProperty.
I was able to set it using OutlookSpy (I am its author) - click IMsgStore button, right click, select IMAPIProp::GetProps, type PR_MAX_SUBMIT_MESSAGE_SIZE - the property is not shown by default, then double click to modify it. I don't know if Outlook will overwrite it on the local cached store later - I never tried to set that property.
Note that the limit is there for a reason - Exchange won't let you send the message if it is over the limit. But it will work if you simply want to get rid of the warming because you will handle the attachment on your own when the message is sent.
You cannot do this, by design. The limit is enforced in the message store to which the submit operation is sent. You could zip the attachment, or chunk it up into separate emails, to allow very large data to be sent.
One of the requirements for the application that I'm working on is to enable users to submit a debugging report to our helpdesk for fatal errors (much like windows error reporting).
I've been told that e-mails must come from a client's mail account to prevent the helpdesk getting spammed and loads of duplicate calls raised.
In order to achieve this, I'm trying to compose a mail message on the server, complete with a nice message in the body for the helpdesk and the error report as an attachment, then add it to the Response so that the user can download, open and send it.
I've tried, without success, to make use of the Outlook Interoperability Component which is a moot point because I've discovered in the last 6 hours of googling that creating more than a few Application instances is very resource intensive.
If you want the user to send an email client side, I don't see how System.Net.Mail will help you.
You have two options:
mailto:support#domain.com?subject=Error&body=Error message here...
get user to download email in some format, open it in their client and send it
Option 1 will probably break down with complex bodies. With Option 2, you need to find a format that is supported by all mail clients (that your users use).
With option 1, you could store the email details locally on your server against some Error ID and just send the email with an Error ID in the subject:
mailto:support#domain.com?subject=Error 987771 encountered
In one of our applications the user hits the generate button and it creates and opens the email in outlook. All they have to do is hit the send button. The functions is below.
public static void generateEmail(string emailTo, string ccTo, string subject, string body, bool bcc)
{
Outlook.Application objOutlook = new Outlook.Application();
Outlook.MailItem mailItem = (Outlook.MailItem)(objOutlook.CreateItem(OlItemType.olMailItem));
/* Sets the recipient e-mails to be either sent by 'To:' or 'BCC:'
* depending on the boolean called 'bcc' passed. */
if (!(bcc))
{
mailItem.To = emailTo;
}
else
{
mailItem.BCC = emailTo;
}
mailItem.CC = ccTo;
mailItem.Subject = subject;
mailItem.Body = body;
mailItem.BodyFormat = OlBodyFormat.olFormatPlain;
mailItem.Display(mailItem);
}
As you can see it is outputting the email in plaintext at the moment because it was required to be blackberry friendly. You can easily change the format to HTML or richtext if you want some formatting options. For HTML use mailItem.HTMLBody
Hope this helps.
EDIT:
I should note that this is used in a C# Application and that it is referencing Microsoft.Office.Core and using Outlook in the Email class the function is located in.
The simple answer is that what you are trying to achieve isn't realistically achievable across all platforms and mail clients. When asked to do the improbable it is wise to come up with an alternative and suggest that.
Assuming that your fault report is only accessible from an error page then you've already got a barrier to spam - unless the spammers can force an exception.
I've always handled this by logging the fault and text into the database and integrating that with a ticketing system. Maybe also have a mailto: as Bruce suggest with subject=ID&body=text to allow the user to send something by email.
I don't think an .eml format file will help either - because they'll need to forward it, and most users would probably get confused.
A .eml is effectively plain text of the message including headers as per RFC-5322.