In vb, trying to send .net (I’m using .net 2) appointment to Groupwise (Novell says it accepts iCal and iMip services). Tried a version, got the email, but when I clicked on the attachment, nothing appeared as an appointment. So, tried again, and now I get a whole new calendar when I click on the ics file - but still no appointment. Any help appreciated... Janet
Dim filePath As String = String.Empty
If System.IO.File.Exists("iCal\2.ics") Then
System.IO.File.Delete("iCal\2.ics")
End If
Dim path As String = HttpContext.Current.Server.MapPath("iCal\")
filePath = path + "2.ics"
Dim myStr As String = String.Empty
myStr = "BEGIN:VCALENDAR" & vbCrLf & _
"VERSION:1.0" & vbCrLf & _
"BEGIN:VEVENT" & vbCrLf & _
"DTSTART:" & DateTime.Now.AddDays(1).ToUniversalTime().ToString("yyyyMMddTHHmmssZ") & vbCrLf & _
"DTEND:" & (DateTime.Now.AddDays(1)).AddMinutes(35).ToUniversalTime().ToString("yyyyMMddTHHmmssZ") & vbCrLf & _
"LOCATION:CDL" & vbCrLf & _
"DESCRIPTION:Click the attached file to receive appointment" & vbCrLf & _
"SUMMARY:testing another appointment" & vbCrLf & _
"TRIGGER:-PT15M" & vbCrLf & _
"PRIORITY:5" & vbCrLf & _
"END:VEVENT" & vbCrLf & _
"END:VCALENDAR"
Dim writer As New System.IO.StreamWriter(filePath)
writer.WriteLine(myStr)
writer.Close()
Dim mail As New System.Net.Mail.MailMessage("yada@emailfrom.net", "yada2@emailto.net", "test email appointment2", "click attached file2 for internet appointment")
mail.Attachments.Add(New System.Net.Mail.Attachment(filePath))
Dim client As New System.Net.Mail.SmtpClient("wahoo")
client.Send(mail)
mail.Attachments.Dispose()
mail.Dispose()
mail = Nothing
Enter your message below
Sign in or Join us (it's free).