I’m trying to create an event in my Microsoft Outlook calendar by using iCalendar standard. I’ve sent an email with content type “text/calendar” to my Exchange mailbox from .NET application.
It arrives to Outlook as an meeting request. Everything looks good, till the moment when I click the received meeting request, Outlook displays it as an empty calendar view with the text: “Meeting cannot be found in the calendar”.
I don’t understand why – I wanted to create an event and it is trying to find some existing?
If I send exactly the same email to whoever participant of the meeting except the organizer, it creates an event in their calendars and everything seems to be ok.
I’ve found that it is caused by the “ORGANIZER” property. If it is set to organizer’s email (my email) and I send meeting request to myself, an event is not created with the information “Meeting cannot be found in the calendar”.
So the question is why it doesn’t create an event for organizer? Organizer must have that event created to be notified by other participants if they have accepted or cancelled the meeting.
Here is the iCalendar:
BEGIN:VCALENDAR
PRODID:-//Company//Product 3.0//EN
VERSION:2.0
CALSCALE:GREGORIAN
METHOD:REQUEST
BEGIN:VEVENT
DTSTART:20130225T200000Z
DTEND:20130225T203000Z
DTSTAMP:20130225T143039Z
ORGANIZER;CN="John Doe":mailto:john.doe#domain.com
UID:20130225T143039Z#domain.com
ATTENDEE;CUTYPE=INDIVIDUAL;ROLE=REQ-PARTICIPANT;RSVP=TRUE;CN="John Smith"
;X-NUM-GUESTS=0:mailto:john.smith#domain.com
CLASS:PUBLIC
CREATED:20130225T143039Z
DESCRIPTION:
LAST-MODIFIED:20130225T143039Z
LOCATION:
SEQUENCE:0
STATUS:CONFIRMED
SUMMARY:Booking test
TRANSP:OPAQUE
END:VEVENT
END:VCALENDAR
Let’s say that organizer want to create an meeting for 2 attendees. He fills in a form in the booking system.
The booking system sends email containing iCalendar standard to himself and to 2 meeting attendees.
This scenario doesn’t work.
It is not possible to create an event (cancellable meeting object) in the calendar of the organizer. The client thinks that email containing iCalendar format is just notification for attendee of the meeting already created in the organizer calendar. If such an email arrives to organizer’s mailbox, client app doesn’t create an event in the organizer’s calendar. It assumes that an event was created by organizer himself. E.g.: Outlook tells you in that case that “Meeting cannot be found in the calendar”.
If you ask Microsoft support about it, they only tell you that they does not support open standards: http://support.microsoft.com/kb/2269506
Working solution to this problem is to use platform services (Exchange Web Services or Google Calendar API) to create an event in the organizer’s calendar. Forget iCalendar standard.
The services can be configured for sending notifications to attendees automatically.
So it is enough to pass “SendInvitationsMode.SendToAllAndSaveCopy” if you’re using EWS:
Appointment appointment = new Appointment(service);
appointment.Subject = "Status Meeting";
appointment.Body = "The purpose of this meeting is to discuss status.";
appointment.Start = new DateTime(2014, 3, 1, 9, 0, 0);
appointment.End = appointment.Start.AddHours(2);
appointment.Location = "Conf Room";
appointment.RequiredAttendees.Add("user1#contoso.com");
appointment.RequiredAttendees.Add("user2#contoso.com");
appointment.OptionalAttendees.Add("user3#contoso.com");
appointment.Save(SendInvitationsMode.SendToAllAndSaveCopy);
or set “sendNotifications” parameter to true in case of Google Calendar API.
You don’t need to send an email to every particular attendee.
This is a bit of an old issue, but i think it is caused from using
METHOD:REQUEST
This marks that the ical should be updated, not that it is a new item. Instead, use
METHOD:PUBLISH
I can confirm that this works with DDay.iCal and Outlook Calendars.
This drove me mad for a week, so it is nice to see someone else confirming what I suspected. There is actually a relatively simple solution, which solves the question, although it is not very elegant. I can understand why one would not be allowed to take the role of Organiser from an outside source, but it is annoying that you can't.
Send out 2 invites. One to yourself (or whoever the organiser is) and then a different one to everyone else.
The one to yourself should have something else other than you down as the ORGANSISER, e.g. ORGANIZER:donotreply#outlook.com
The one to everyone else should have your email down as the organizer.
For this approach to work, you should set METHOD:REQUEST. If you set it to PUBLISH you will get duplicates on updates.
This approach means you get the meeting in your diary and you also get replies (to get replies you need to include the following line for each attendee:
ATTENDEE;CN="The Name";RSVP=TRUE:mailto:the_email#address.com.)
Note that the UID is the same for both versions of the file. It helps if the ORGANISER gets the Invite first so they can accept it before they start getting replies, otherwise people will be replying to something that effectively does not yet exist. That wont stop them accepting the invite, but it might be a little confusing for the ORGANIZER. To help with this I put in a slight delay between email 1 and 2.
I would assume that your problem is because Exchange assumes that the organizer of the event is also the originator of the event. Which seems fair enough, as otherwise it would be child's play to send meetings to people making them the organizer and they would be added automatically to the person's calendar.
All that said, no idea how to get around the issue.
the behavior of event invitation being sent by email is described in rfc6047 which further extends the icalendar RFC (RFC5545).
section 2 and section 3 on security, summarizes two spoofing threats:
spoofing the "Organizer", and spoofing an "Attendee"
that is
spoof#xyz.example.net is not allowed to modify or cancel a meeting that was organized by a#example.com.
to your case:
did you send the invitation from the same email address as your exchange (talking about the From: in the mail not the Organizer:mailto ? if not it might be worth trying to send it via the exchange address.
should above not work, to address your need for the organizer to have the invitation in its calendar you probably will need to add it programmatically in the organizer's agenda as it is likely that the CUA (Calendar User Agent) or Exchange does not allow a 3rd party mailer to add events in agenda without end-user UI usage.
In recent months ,our service also meet the same problem as you:
our service create meeting calendar for organizer and attendees,
if attendees contains organizer ,organizer (as a atteendee) can get a calendar email,
but it does neither be allowed to receive/reject the meeting(the button is disabled) nor see it in calendar(no calendar event).
finally, I notice that only when under following condition this will happen:
1. mail.From = organizer
2. Ateendees.contains(organizer) //case-insensitive.
So , I simply change my code to follwing , and it works fine for all attendees (include organizer):
if (!attendeeEmail.ToLower().Contains(organizer.Address.ToLower()))
{
message.From = organizer;
}
else
{
//such as your actual email sender, in our case, our mail sender use another email,
//say ActualSender,and if leave empty, then our mail sender will fill as:
message.From = ActualSenderEmail;
}
Related
I want to use mail chimp for the newsletter on my web form.
When the user subscribes, I want to show on the page the unsubscribe form.
But, how can I check if the user has already subscribed ?
Is there a way to check it from the mail chimp ?
I just want to find the logic to write my code.
Have a look at the Mailchimp API guide. There is:
/lists/{list_id}/members/{subscriber_hash}
which returns the user. If no user is returned, he is not in the list; if a user is returned, check his status (could be subscribed, unsubscribed, cleaned, pending).
The {list_id} if of course the list of the list you want to search; the {subscriber_hash} is the MD5 hash of the email address you want to find.
Sorry if I failed to find an existing post with my problem.
What am I trying to do is as follows:
I simply want to send a couple of emails (2-3) to different people and more importantly with different content. The emails are official, important and also logged in the system. Long story short, I need when for some reason one of them fails to stop the sending of the others. I need either all of them sent or none of them.
What have I done so far
It is not the first time the system I worked on has to send an automatic email. The application is an ASP MVC website. So some time ago, I installed the MvcMailer (MvcMailer) and used it the way it was explained. It worked quite well and so I liked the idea of previewing the email (as you can give it a view to send).
So, in the light of my new problem I read carefully the MvcMailer documentation and did not find anything about sending multiple emails in transaction-like manner. Couldn't think of a way to force them to behave in this way. In my tests when I send an email, even if it is one email with a few CCs, all working mails get send and just one of them fails (wrong email name, closed port ... whatever).
I was hoping someone could suggest me a way to achieve something like this. I hope my explanation was sufficient and if not, let me know I will provide you with all details required.
If this is impossible with the MvcMailer, then is it possible with other tools ?
My implementation so far: (keep in mind I'm still in the testing stages)
public class MailerController : Controller
{
private MailerRepository mailerRep;
public MailerController()
{
this.mailerRep = new MailerRepository();
}
public void TestTransmittalEmail()
{
var model = this.mailerRep.GetTransmittalModel(1234); //I've stucked a specific clientId
var mailer = new TransmittalsMailer();
mailer.TransmittalEmail(model).Send();
}
}
public class TransmittalsMailer : MailerBase
{
public TransmittalsMailer()
{
}
public MvcMailMessage TransmittalEmail(TransmittalManifestModel model)
{
var mailMessage = new MvcMailMessage() { Subject = "Transmittals - TESTING EMAIL" };
//embedding a few images in the email
var resources = new Dictionary<string, string>();
resources["logo"] = PDFResourcePaths.VripackLogo;
resources["companyInfo"] = PDFResourcePaths.CompanyInfoBlock;
mailMessage.To.Add("test1#email.com");
mailMessage.Attachments.Add(new Attachment(#"D:\ASD\TransmittalFolders\1\Archives\150812.1433.MMA.rar"));
ViewData["model"] = model;
this.PopulateBody(mailMessage, "TransmittalEmailView", resources);
return mailMessage;
}
}
This is actually quite a difficult problem to solve. This is because when you send an email, it will work as long the SMTP server can be found (no exception will be thrown).
So you basically have to wait some arbitrary amount of time, and check the inbox of the email you sent it from for the delivery failure. If there is a delivery failure, you stop sending.
So long story short, you shouldn't probably do this. You should simply send all three and notify yourself some other way (probably another email) that there was a failure and which email failed.
You can check if an exception is thrown and then cancel the sending of subsequent emails until the issue is addressed. However this only deals with issues on your end on the sending of each email individual email. If the first two mails are successfully sent, and the last throws an exception, you can't unsend the first emails.
A possible workaround (ugly as it is) would be to initially send emails to an email address you control. If an exception is thrown at this step, log the error, and do not send any further emails until the error is dealt with. If no exceptions are raised, send the emails. However this does not and cannot handle issues that may occur on the recipients side.
A delivery failure notice is not guaranteed as depending on the configuration of your SMTP and the recipient SMTP a delivery failure notification might not be sent. Even if delivery failure notifications are enabled, the notification might not be sent for days (in one of my previous jobs, email delivery failure notifications were not sent until 14 days had elapsed).
Ideally, this should be dealt with at the initial input of the email addresses before you ever send any documents to anyone. You simply send a verification email to the email address in question and have the user clicking on a verification link back to a web service you control. Until this has been done, you don't send any emails to the intended recipient.
When ever I create a meeting in Outlook, Subject field for an appointment is going through incorrectly. Instead of something like "Test" I get the name of the user who created an appointment.
-> bold = title, admin = creator name
-> admin = creator name even though it suppose to be subject.
foreach (Appointment a in room.appointments)
m.Subject = a.Subject
Is this a known issue; Is there another field that is responsible for subject?
This is actually not an "issue" but a "feature" of Exchange's workflow for meeting invites. The default on a room resource is to replace the subject with the orgranizer. This can be changed for a room with a PowerShell command:
Set-Calendarprocessing -Identity:roommb -AddOrganizerToSubject:$false -DeleteSubject:$false
Of course you need proper permissions to do this, or else bribe your Exchange admin!
In work we have service mailbox and suddenly started coming mails with attachement daily, no one know why and how to stop that and nobody need that.
So im writing deleting script and i dont know how to detect/find these emails, because Cc field is blank and email with same Subject from same email address is already coming but difference is between alias, how can i read information from the image ?
I need declare a SearchFilter like
SearchFilter subjectFilter =
new SearchFilter.ContainsSubstring(ItemSchema.?WHATHERE?, "JOBRUN <something#company.com>");
Thank you :-)
If I do understand you correctly, and based on your screenshot, you want to get those emails that have the string JOBRUN in their Display Name (not in their Subject as your variable name states).
Altough I'm not sure if the following does the filtering based on the email-address of the sender only or additionally based on the sender's displayname (the documentation is pretty poor...), you could try the following:
var filter = new SearchFilter.ContainsSubstring(EmailMessageSchema.Sender, "JOBRUN");
i am using Interop.Domino.dll and able to send mail via c# code to lotus notes 8.5 users.
now i want to send appointment invations to users via c# code.
here is my code.
oNotesDocument.ReplaceItemValue("Form", "Appointment");
oNotesDocument.ReplaceItemValue("AppointmentType", "3"); // meeting
oNotesDocument.ReplaceItemValue("Subject", "Deneme Toplantı");
oNotesDocument.ReplaceItemValue("CALENDARDATETIME", StartDate);
oNotesDocument.ReplaceItemValue("StartDateTime", StartDate);
oNotesDocument.ReplaceItemValue("EndDateTime", EndDate);
oNotesDocument.ReplaceItemValue("StartDate", StartDate);
//oNotesDocument.ReplaceItemValue("MeetingType", "1");
oNotesDocument.ReplaceItemValue("Required", "xx\\xx.xx");
oNotesDocument.ReplaceItemValue("SendTo", "xx#xx.com");
oNotesDocument.ReplaceItemValue("From", "xx#xx.com");
oNotesDocument.ReplaceItemValue("Principal", "pr.incipal");
oNotesDocument.ReplaceItemValue("Chair", "erdem.tomus");
oNotesDocument.ReplaceItemValue("Location", "location test");
oNotesDocument.ReplaceItemValue("Body", an invitation");
oNotesDocument.ComputeWithForm(true, false);
oItemValue = oNotesDocument.GetItemValue("SendTo");
//Send the email
oNotesDocument.Send(false, ref oItemValue);
i am able to send invitation but i wasn'T able to fill the attendees on who part of a lotus notes appointment form. will appreciate help on this.
Infact i need ReplaceItemValue on who property but it didn't work like that.
Thanks
The "EnterSendTo" field is used when the appointment form is open to let the user enter the attendees for the meeting. I believe that gets translated to the "RequiredAttendees" item on the document once the meeting is sent.
From your code you could try:
oNotesDocument.ReplaceItemValue("EnterSendTo", "xx#xx.com");
Put that before the call to ComputeWithForm and it should work. Otherwise, try replacing the value of the RequiredAttendees item and see if that works.
Alternatively, you could send calendar entries using the iCal format. A quick search on SO led me to this question: Creating iCal Files in c#. It appears there is a decent C# class library you could use to generate iCal files, and Domino mail should recognize them.