Sending a meeting request from ASP.net 2.0

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Does anybody know how to send a meeting request using an ics/vcs (VCalendar)
attachment from an asp.net page. I don't want my users to have to double
click on the attachment but rather that it is simply recognised automatically
as a meeting request.

The article below shows an example of very close to what I am trying to do.
The difference being that I want the email to be sent as a meeting request
not as an
attached ics file.

http://dotnetjunkies.com/WebLog/shaunakp/archive/category/2312.aspx

Thanks in advance for your help.
 
Hi all,

Based on my research so far, I found that we can use WebDAV to send Meet
Request directly.
If the information is stored in the VCalendar file, I think we may parse
the VCalendar(it is a text file) and got the required information and
sending the meeting request directly with WebDav.
Here is a KB for your reference.
308373 How to send a meeting request by using WebDAV
http://support.microsoft.com/default.aspx?scid=kb;EN-US;308373

Although it is in VB6, but the key point in WebDav is to send the HTTP
Request to the Exchange Server.
In VB6, we use XMLHTTP library, but in .NET, we have a similar class
HTTPWebRequest which did the same job.

Here is another KB about how to send work with WebDAV in .NET via
HTTPWebRequest.
313121 How to create an Outlook Calendar folder by using WebDAV in Visual C#
http://support.microsoft.com/default.aspx?scid=kb;EN-US;313121

313128 How to send an e-mail message by using WebDAV in Visual C#
http://support.microsoft.com/default.aspx?scid=kb;EN-US;313128

314198 How to use the HttpWebRequest class and the HttpWebResponse class to
modify the properties of an object in Visual Basic .NET
http://support.microsoft.com/default.aspx?scid=kb;EN-US;314198

If you have any other concern, please feel free to let me know.

Best regards,

Perter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 
Peter,

Thank you for your response. However I am not running Webdav and we do not
have Exchange in our enironment.

Below is the code that I have so far. This creates the ics file and places
it as an attachment to an email. However it does not send the email as a
meeting request. It simply sends the email with an attachment. I think I need
to change something in the emails header to make the receiving email client
recognise that it is being sent a meeting request not an email. I am not
quite sure how or what though and that is my question...

Public Function SendAppoinment(ByVal Method As String, ByVal startDate
As String, _
ByVal startTime As String, ByVal endTime As String,
ByVal subject As String, _
ByVal summary As String, ByVal location As String, ByVal
attendeeName As String, _
ByVal attendeeEmail As String, ByVal organizerEmail As
String, _
ByVal organizerName As String, ByVal emailBody As
String, ByVal GUID As String) As Boolean

Const c_strTimeFormat = "yyyyMMddTHHmmssZ"
Dim sStartTime As String = ""
Dim sEndTime As String = ""
Dim sTimeStamp As String = ""
Dim sTempStartTime As String = ""
Dim sTempEndTime As String = ""
Dim sCalendarFile As String = ""

Const VCAL_FILE = "BEGIN:VCALENDAR" & vbCrLf & _
"VERSION:2.0" & vbCrLf & _
"METHOD{0}" & vbCrLf & _
"BEGIN:VEVENT" & vbCrLf & _
"STATUS{1}" & vbCrLf & _
"DTSTART{2}" & vbCrLf & _
"DTEND{3}" & vbCrLf & _
"TRANSP:OPAQUE" & vbCrLf & _
"SEQUENCE:0" & vbCrLf & _
"LOCATION;ENCODING=QUOTED-PRINTABLE:{4}" & vbCrLf
& _
"ORGANIZER;CN=""{5}/OHA"":mailto:{6}" & vbCrLf & _
"UID : {7}" & vbCrLf & _
"DESCRIPTION;ENCODING=QUOTED-PRINTABLE:{8}" &
vbCrLf & _
"CLASS:PUBLIC" & vbCrLf & _
"SUMMARY;ENCODING=QUOTED-PRINTABLE:{9}" & vbCrLf & _
"TRIGGER:-PT15M" & vbCrLf & _
"PRIORITY:3" & vbCrLf & _
"END:VEVENT" & vbCrLf & _
"END:VCALENDAR"


Dim sMethod As String = ":" & Method
Dim sStatus As String = ":CONFIRMED"
Dim dtStartDate As DateTime = DateTime.Parse(startDate.ToString())
Dim dtStartTime As DateTime = DateTime.Parse(startDate + " " +
startTime.ToString())
Dim dtEndTime As DateTime = DateTime.Parse(startDate + " " +
endTime.ToString())
sTempStartTime = String.Format("{0} {1}",
dtStartDate.ToShortDateString(), dtStartTime.ToLongTimeString())
sTempEndTime = String.Format("{0} {1}",
dtStartDate.ToShortDateString(), dtEndTime.ToLongTimeString())
sTimeStamp =
(DateTime.Parse(sTempStartTime)).ToUniversalTime().ToString(c_strTimeFormat)
sStartTime = String.Format(":{0}", sTimeStamp)
sEndTime = String.Format(":{0}",
(DateTime.Parse(sTempEndTime)).ToUniversalTime().ToString(c_strTimeFormat))
sCalendarFile = String.Format(VCAL_FILE, sMethod, sStatus,
sStartTime, sEndTime, location, organizerName, organizerEmail, GUID, summary,
subject)

' Create the mail message

Dim mail As MailMessage = New MailMessage()
Dim sc As SmtpClient
Dim maTo As MailAddress = New MailAddress(attendeeEmail.Trim(),
attendeeName)
Dim maFrom As MailAddress = New MailAddress(organizerEmail.Trim(),
organizerName)
mail = New MailMessage(maFrom, maTo)
mail.Subject = subject
mail.Body = emailBody

' create the attachment by converting the text to a byte array and
placing it in a
' memory stream object

Dim bAttach() As Byte = Encoding.ASCII.GetBytes(sCalendarFile)
Dim msAttach As New System.IO.MemoryStream(bAttach)
Dim aAttach As Attachment = New Attachment(msAttach, "Event.ics")
mail.Attachments.Add(aAttach)


sc = New SmtpClient(ConfigurationManager.AppSettings("EmailServer"))
sc.Send(mail)

Return True

End Function


Regards,
James
 
Hi James,

Thanks for your detailed information.
Currently I am performing further researching about this issue, and I will
update you with new information ASAP.

Best regards,

Perter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 
Hi James,

Sorry for delay response.

I am writing to check if you are still monitoring the thread.
To further understand your scenario, I would like to collect more
information about y our concrete environment.
So can you send a Email to me via removing "online" from my email address.

Thanks!

If you still have any concern, please feel free to let me know.

Best regards,

Perter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 
Peter,

I am still monitoring the thread. There is not much to say about the
environment. I am running ASP.net 2.0 on top of IIS and attempting to send
meeting requests to Lotus Notes. We do not run Exchange within our
organisation. Please let me know if I can be of any further assistance.

Regards,
James Clark
 
Hi James,

I am following up on this thread to share the resolution with the rest of
the community.

My understanding is that the CSS engineer that you worked with reported:

The CSS engineer noticed you were using System.Web.Mail and the CSS
engineer realized that CDOSYS would be the most appropriate library to use
here. System.Web.Mail is actually a wrapper around CDOSYS (CDO for Windows
2000).

It is possible to use CDOSYS to construct an email message and then add a
body part containing the iCal. How that request is being interpreted is
dependent on messaging client (Outlook, Outlook Express, etc.) used to read
that MIME message. Therefore CDOSYS would be the most appropriate library
for the scenario for this thread.

Best Regards,

Tommy Campbell, MCSA, MCSE
Microsoft Online Support Engineer
Get Secure! - www.microsoft.com/security
=====================================================
When responding to posts, please "Reply to Group" via
your newsreader so that others may learn and benefit
from your issue.
=====================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
Back
Top