my smtp settings (this works with all other emails)
I changed the main message part to multipart/mixed, still error.
as test, I also did the following:
(1)
it was sent with no errors, the event was attached as an ICS file, no 'accept/decline' on email
mail.txt:
(2)
blew up.
Mail.txt:
So, 'something' is missing specifically when I'm sending it with a request method. just not sure what.
after more banging my head against my desk, I tracked this down to using outlook 365 as my email server.
if I use my gmail account for outgoing email, it works just fine (the email has the accept/tentative/decline buttons when sent to my outlook account).
any further ideas?
Code:
SMTP.Host := cdsDefaultSettings.FieldByName('SERVERNAME').AsString;
SMTP.Username := cdsDefaultSettings.FieldByName('USERNAME').AsString;
if cdsDefaultSettings.FieldByName('Enable_ssl').AsBoolean then
begin
SMTP.AuthType := satDefault;
SMTP.Password := DecryptStr(cdsDefaultSettingsACCOUNT_ID.AsInteger);
end
else
SMTP.AuthType := satNone;
if (not IsNullStr(cdsDefaultSettings.FieldByName('PORT').AsString)) and
(cdsDefaultSettings.FieldByName('PORT').AsInteger <> 0) then
SMTP.Port := cdsDefaultSettings.FieldByName('PORT').AsInteger
else
SMTP.Port := 25;
if cdsDefaultSettings.FieldByName('flags').AsInteger <> 0 then
begin
IOHandler.Host := SMTP.host;
IOHandler.Port := SMTP.Port;
if cdsDefaultSettings.FieldByName('flags').AsInteger = 4 then
ioHandler.sslOptions.method := sslvTLSv1_2
else
ioHandler.SSLOptions.Method := TIDSSLVersion(cdsDefaultSettings.FieldByName('flags').AsInteger - 1);
SMTP.IOHandler := ioHandler;
if cdsDefaultSettings.FieldbyName('flags').AsInteger = 4 then
SMTP.UseTLS := utUseExplicitTLS;
end
else
begin
SMTP.ioHandler := nil;
SMTP.UseTLS := utNoTLSSupport;
end;
// end;
emMessage.From.Address := cdsDefaultSettings.fieldByName('username').AsString;
if not isNullStr(cdsDefaultSettings.fieldByname('display_name').AsString) then
emMessage.From.Name := cdsDefaultSettings.FieldbyName('display_name').AsString
else
emMessage.From.Name := globalConnection.LoginRec.LoginName;
if cdsuserEmail.IsEmpty then
emMessage.ReplyTo.EMailAddresses := cdsDefaultSettings.fieldByName('username').AsString
else
emMessage.ReplyTo.EMailAddresses := cdsUserEmail.fieldByName('email_prime').AsString;
emMessage.From.Address := emMessage.ReplyTo.EmailAddresses;
I changed the main message part to multipart/mixed, still error.
as test, I also did the following:
(1)
Code:
dmEmail.emMessage.ContentType := 'text/calendar;method=PUBLISH';
dmEmail.emmessage.Body.Text := eventText.Text;
// with tIDText.Create(dmEMail.emMessage.Messageparts) do
// begin
// ContentType := 'text/calendar;method=PUBLISH';
// Body.Text := eventText.Text;
// end;
// with TIdAttachmentFile.Create(dmEmail.emMessage.MessageParts, fName) do
// begin
// ContentDisposition := 'inline';
// ContentType := 'text/calendar;method=REQUEST';
// ExtraHeaders.Values['Content-ID'] := ExtractFileName(fName);
// ContentID := ExtractFileName(fName);
// Filename := ExtractFilename(fName);
//// parentPart := 1;
// end
mail.txt:
Code:
Subject: Meeting
To: Conniem@provantagesoftware.com
Content-Type: text/calendar; method=PUBLISH; charset=us-ascii; boundary="Z3x5XLdCh3=_gG99ZJaoS8M91yBNfYNSeh"
MIME-Version: 1.0
Date: Wed, 28 Aug 2019 07:19:40 -0700
BEGIN:VCALENDAR
PRODID:-www.provantagesoftware.com/v1.0/id=179
VERSION:2.0
METHOD:REQUEST
BEGIN:VEVENT
ORGANIZER;CN=Connie M.:MAILTO:Conniem@provantagesoftware.com
DTSTART:20190831T000000Z
DTEND:20190831T010000Z
TRANSP:OPAQUE
SEQUENCE:0
UID:179
DTSTAMP:20190828T071900Z
DESCRIPTION:Gun Range Location
SUMMARY:Meeting
PRIORITY:2
ATTENDEE;RSVP=TRUE:mailto:Conniem@provantagesoftware.com
END:VEVENT
END:VCALENDAR
--Z3x5XLdCh3=_gG99ZJaoS8M91yBNfYNSeh
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
--Z3x5XLdCh3=_gG99ZJaoS8M91yBNfYNSeh--
.
(2)
Code:
dmEmail.emMessage.ContentType := 'text/calendar;method=REQUEST';
dmEmail.emmessage.Body.Text := eventText.Text;
blew up.
Mail.txt:
Code:
Subject: Meeting
To: Conniem@provantagesoftware.com
Content-Type: text/calendar; method=REQUEST; charset=us-ascii; boundary="Ei51sGtBwQfH=_1ikzmtp4ojmouS052Uh1"
MIME-Version: 1.0
Date: Wed, 28 Aug 2019 07:23:56 -0700
BEGIN:VCALENDAR
PRODID:-www.provantagesoftware.com/v1.0/id=179
VERSION:2.0
METHOD:REQUEST
BEGIN:VEVENT
ORGANIZER;CN=Connie M.:MAILTO:Conniem@provantagesoftware.com
DTSTART:20190831T000000Z
DTEND:20190831T010000Z
TRANSP:OPAQUE
SEQUENCE:0
UID:179
DTSTAMP:20190828T072300Z
DESCRIPTION:Gun Range Location
SUMMARY:Meeting
PRIORITY:2
ATTENDEE;RSVP=TRUE:mailto:Conniem@provantagesoftware.com
END:VEVENT
END:VCALENDAR
--Ei51sGtBwQfH=_1ikzmtp4ojmouS052Uh1
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
--Ei51sGtBwQfH=_1ikzmtp4ojmouS052Uh1--
after more banging my head against my desk, I tracked this down to using outlook 365 as my email server.
if I use my gmail account for outgoing email, it works just fine (the email has the accept/tentative/decline buttons when sent to my outlook account).
any further ideas?