У меня есть проблемы с Gmail и мой Анонсы, это просто Анонсы:Почему мои не Анонсы признаны Gmail
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//www.notilus.com//Dimo Gestion Notilus//FR
CALSCALE:GREGORIAN
METHOD:REQUEST
X-MS-OLK-FORCEINSPECTOROPEN:TRUE
BEGIN:VEVENT
DTSTART:20140619T080132Z
DTEND:20140619T090132Z
DTSTAMP:20140619T080132Z
ORGANIZER;[email protected]:mailto:[email protected]
ATTENDEE;CUTYPE=INDIVIDUAL;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=
FALSE;[email protected];X-NUM-GUESTS=0:mailto:[email protected]
CREATED:20140619T080132Z
DESCRIPTION:Description of flying to Sligo
X-ALT-DESC;FMTTYPE=text/html:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//E
N">\n<html>\n<body>\n<table border="1"><tr><td>\n<b>HTML</b> Description o
f flying to Sligo\n</td></tr><tr><td>\n<ul><li>HTML has certain advantages
</li></ul>\n</td></tr></table>\n</body>\n</html>
LAST-MODIFIED:20140619T080132Z
LOCATION:
SEQUENCE:0
STATUS:CONFIRMED
SUMMARY:Fly to Sligo
TRANSP:OPAQUE
UID:20140619T080132Z
END:VEVENT
END:VCALENDAR
Все работает, если я придаю его прямо из Gmail.
Если я отправлю с моего сайта, это не так.
вот мой код:
using (var smtp = new SmtpClient())
{
var subject = "Confirm";
var message = new MailMessage();
message.To.Add(email);
message.Subject = subject;
var loCalendarType = new System.Net.Mime.ContentType();
loCalendarType.MediaType = "text/calendar";
loCalendarType.Parameters.Add("method", "REQUEST");
loCalendarType.CharSet = @"""utf-8""";
loCalendarType.Name = "event.ics";
// Create message body parts
var loCalendarView = AlternateView.CreateAlternateViewFromString(ical, loCalendarType);
loCalendarView.TransferEncoding = System.Net.Mime.TransferEncoding.SevenBit;
message.AlternateViews.Add(loCalendarView);
// html
message.AlternateViews.Add(AlternateView.CreateAlternateViewFromString(html, Encoding.UTF8, System.Net.Mime.MediaTypeNames.Text.Html));
smtp.Send(message);
}
и это мим послал:
Delivered-To: [email protected]
Received: by 10.217.130.201 with SMTP id dv51csp438169web;
Mon, 28 Jul 2014 03:31:02 -0700 (PDT)
X-Received: by 10.194.243.200 with SMTP id xa8mr47346727wjc.97.1406543462611;
Mon, 28 Jul 2014 03:31:02 -0700 (PDT)
Return-Path: <[email protected]>
Received: from mail-wg0-x22c.google.com (mail-wg0-x22c.google.com [2a00:1450:400c:c00::22c])
by mx.google.com with ESMTPS id s3si12813117wic.21.2014.07.28.03.31.02
for <[email protected]>
(version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
Mon, 28 Jul 2014 03:31:02 -0700 (PDT)
Received-SPF: pass (google.com: domain of [email protected] designates 2a00:1450:400c:c00::22c as permitted sender) client-ip=2a00:1450:400c:c00::22c;
Authentication-Results: mx.google.com;
spf=pass (google.com: domain of [email protected] designates 2a00:1450:400c:c00::22c as permitted sender) [email protected];
dkim=pass [email protected];
dmarc=pass (p=NONE dis=NONE) header.from=gmail.com
Received: by mail-wg0-f44.google.com with SMTP id m15so7011538wgh.3
for <[email protected]>; Mon, 28 Jul 2014 03:31:02 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20120113;
h=message-id:date:mime-version:from:to:subject:content-type
:content-transfer-encoding;
bh=3k0Ih6rGieP/qB5GSChSJva4900sXW0sQFSUWVfWfbk=;
b=YiK7r5XcO9llXe9ek1NVyZnSifa1qie9Twk7dwnTsa90+xOrRrDb4VI2VUnJv4QRHm
kOE4s/SUiXZpzZBA5Eiqc2cygxn2H5i4+tVEx6bV0MggqG4A+YfbhEkR5aP2EzaOdOy5
cozy5HDBpdYv1AFpcGIOrQz0vJs4OIUTi4lZTw57ViM/PwxzkCDcseOPezGWoFXjXCBK
8p+IV4JWn/b7uuu/BK/ZNcawES72OgwkVx9aqL6m/gz3wJuF4Qh5orxcqWvO7L2T5R8M
s+7hLBpHY8Os0U2EBa/wmihhdWj1RdnZlwntfdGTMJB5SnFD6J1WWFzlrzXzScHxVMsP
+9UA==
X-Received: by 10.180.24.66 with SMTP id s2mr29127288wif.33.1406543460817;
Mon, 28 Jul 2014 03:31:00 -0700 (PDT)
Return-Path: <[email protected]>
Received: from max-pc ([80.86.155.45])
by mx.google.com with ESMTPSA id lh15sm29883233wic.10.2014.07.28.03.30.59
for <[email protected]>
(version=TLSv1 cipher=ECDHE-RSA-AES128-SHA bits=128/128);
Mon, 28 Jul 2014 03:30:59 -0700 (PDT)
Message-ID: <[email protected]>
Date: Mon, 28 Jul 2014 03:30:59 -0700 (PDT)
X-Google-Original-Date: 28 Jul 2014 12:30:54 +0200
MIME-Version: 1.0
From: [email protected]
To: [email protected]
Subject: Confirm
Content-Type: text/calendar; method=REQUEST
Content-Transfer-Encoding: 7bit
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//www.notilus.com//Dimo Gestion Notilus//FR
CALSCALE:GREGORIAN
METHOD:REQUEST
X-MS-OLK-FORCEINSPECTOROPEN:TRUE
BEGIN:VEVENT
DTSTART:20140619T080132Z
DTEND:20140619T090132Z
DTSTAMP:20140619T080132Z
ORGANIZER;[email protected]:mailto:[email protected]
ATTENDEE;CUTYPE=INDIVIDUAL;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=
FALSE;[email protected];X-NUM-GUESTS=0:mailto:[email protected]
CREATED:20140619T080132Z
DESCRIPTION:Description of flying to Sligo
X-ALT-DESC;FMTTYPE=text/html:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//E
N">\n<html>\n<body>\n<table border="1"><tr><td>\n<b>HTML</b> Description o
f flying to Sligo\n</td></tr><tr><td>\n<ul><li>HTML has certain advantages
</li></ul>\n</td></tr></table>\n</body>\n</html>
LAST-MODIFIED:20140619T080132Z
LOCATION:
SEQUENCE:0
STATUS:CONFIRMED
SUMMARY:Fly to Sligo
TRANSP:OPAQUE
UID:20140619T080132Z
END:VEVENT
END:VCALENDAR
Я прочитал почти все об этом, но я действительно не могу понять, что случилось с моим код. Это всегда отображается как приложение, а не как назначение.
Вы знаете https: //www.nuget .org/пакеты/DDay.iCal /? Может помочь вам ... – ChrFin
Я уже пробовал, но результат тот же ... –
Вы отправляете данные iCal как тело письма? Я думаю, вам нужно прикрепить файл iCal ... – ChrFin