How do i delete mails from IMAP Server. I am using chilkat
Chilkat.EmailBundle bundle = imapClient.FetchHeaders(mset);
There is a method in bundle but it does not delete the mail from Server.
Regards
Sanchaita
There is good documentation (including code examples) on the Chilkat website:
Delete Email Individually (One at a time) from an IMAP Mailbox
Also:
Delete Email from an IMAP Mailbox
Other IMAP examples:
IMAP C# Examples
Hope these help.
Edit:
As per the documentation on the page below:
Chilkat C# EmailBundle Class Reference
Both the RemoveEmail and RemoveEmailByIndex methods only remove the emails from the bundle and not from the server. You will need to use another method as described in the links above to remove the message from the server.
Edit
I am not very familiar with the Chilkat library however from the documentation it seems like the "GetEmail" method in the EmailBundle class will retrieve a mail at a certain index and then you can use the "AppendMail" method in the IMap class to upload the mail to a particular inbox as specified in the following example:
Upload (Append) Email to an IMAP Mailbox
I hope this helps, if it does please mark it as answered.
Related
I am working on a small C# console Utility. As https://outlook.office365.com/EWS/Exchange.asmx is disabled by Microsoft So I am not able to authenticate the Microsoft account getting 401 unauthorized error.
I am trying to find other ways to implement the logic.
So, what are the other options/ways to authenticate Microsoft account and read emails (Unibody, from, ConversaionId, InternetMessageId, DateTimeReceived, subject, body) from Outlook inbox with filters. Like: passing the date range and count of emails.
example: if I want to read last 24 hrs. received emails how can I extract all information like Unibody, from, ConversaionId, InternetMessageId, DateTimeReceived, subject, body from each email.
Please help.
I have come into ownership of a ASP.NET MVC site that utilizes Biztalk 2013 to handle tasks like sending emails. I am completely new to biztalk so forgive obvious mistakes in this post.
Quick overview
The service is called through the application and then the orchestration calls a stored procedure in a sql db to populate some of values for the email (including html for the email) and then sends the email out.
I now want to add a pdf attachment to the email.
As a test, I added a pdf file to the server and then I have tried adding ActualEmailMsg(SMTP.Attachments) = "C:\\PDFs\\test.pdf";
ActualEmailMsg(SMTP.MessagePartsAttachments) = 2; to the message assignment expression shape as suggested in this post to no avail. (I also tried the physical path with only 1 "\" like "C:\\PDFs\test.pdf" and that didn't work)
I have ruled out the possibility of a lack of permissions from the service account to the PDF folder. The email sends correctly but no attachment is present. I am getting no errors in the code or in the event viewer on the server so at this point I am at a loss for what it might be.
After lots of googling I found the issue was related to the send pipeline. This thread got me on the right track.
In the send ports section of the BizTalk Admin Console of the app, the send pipeline was using a custom pipeline I believe was made by the previous owner. I changed it to the 'Pass Thru Transmit' type in the dropdown and it is now working.
I use the following pattern for sending Emails. I’m not sure but maybe you need to use the ActualEmailMsg(MIME.FileName) attribute for message in email.
ActualEmailMsg(MIME.FileName) ="Report_{"+FullFileName+"}.xml";
ActualEmailMsg(SMTP.CC)=ReportNotificationEmailAddress;
ActualEmailMsg(SMTP.Subject)="Report Notification Email";
ActualEmailMsg(SMTP.EmailBodyFile)=#"C:\...\ReportNotificationBody.htm";
ActualEmailMsg(SMTP.Attachments)=#"C:\..\ReportNotificationBody.png”;
ActualEmailMsg (SMTP.EmailBodyTextCharset)="UTF-8";
I am developing an email client using EWS api. I know for each item(email), I can use Move function to move the item into a specific folder. I noticed that in WellKnkownFolderName there is a JunkEmail. I wonder after is use Move function move that item into junkemail folder, does that mean the server will ban future emails coming from that sender?
EmailMessage current = EmailMessage.Bind(service, id);
current.Move(WellKnownFolderName.JunkEmail);//Does JunkEmail means spam? Or it is just a normal email folder as inbox, draft, sent etc
No, Exchange will not automatically move future emails to the junk folder based on this mail.
I'm using Google's .NET Client Library to read email on my gmail account.
But things are not very clear for me.
I'm trying to retrieve Atom feeds with this code.
FeedQuery query = new FeedQuery();
Service service = new Service("mail", "app-MailChecker-1");
service.setUserCredentials(Username, Password);
query.Uri = new Uri("https://mail.google.com/mail/feed/atom");
AtomFeed feed = service.Query(query);
It gives me a simple exception: can't retrieve feed.
My priority is to accomplish this using Google's .NET Client Library
but other options will be helpful as well.
Additional information: this method works for Google Calendar without a problem.
If you read Google's FAQ about the Google Data Protocol you'll see that it has no data API for GMail.
http://code.google.com/intl/nl-NL/apis/gdata/faq.html#GmailAtomFeed
To quote:
Does Gmail have a Data API?
No, but you can use Gmail's Atom feed with AuthSub or OAuth to request
read-only access to a user's unread messages. The scope should be set
to https://mail.google.com/mail/feed/atom/. An example query would be:
GET https://mail.google.com/mail/feed/atom/
If you're interested in managing your mail, Gmail also has IMAP/POP
support.
I experimented with version 1.9.0.0 of the Google Data .NET Client Library myself. Don't see any references to GMail.
Here's one possible approach on how to retrieve the unread messages:
http://www.dotnetcurry.com/ShowArticle.aspx?ID=292
It's similar to what Christian suggested in his comment.
I am using this library IMAPX to get emails.
I also need to send emails but cannot figure out how.
I tried using the example code:
client.Folders["INBOX"].AppendMessage(msg)
but receive an error that AppendMessage requires two arguments and I cannot figure out what the second argument should be.
Is it possible to send an email with this library and if so how?
According to Reflector, it looks like the second parameter should be a string giving the flags for the new message; it looks like the ImapFlags class gives a list of available flags.
If you want more background in IMAP, then you should read its RFC.
However, the IMAP protocol is NOT used to send mail, it's used to read or retrieve mail that's in a mailbox on a server. You can use it to add messages to your own mailbox (as you're trying to do here), but that isn't what most people mean when they talk about sending email... SMTP is the standard way to send email.