Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
sending event email
#2
(08-27-2019, 02:33 PM)ccMcBride Wrote:
Code:
dmEmail.emMessage.ContentType := 'text/calendar;method=REQUEST';

That is the wrong ContentType value to use at the top level of the email when multiple parts are used in the TIdMessage.MessageParts collection.  It MUST be set to a 'multipart/...' media type instead, in this case 'multipart/mixed' since you have an standalone attachment that is not referred to by the text parts.

(08-27-2019, 02:33 PM)ccMcBride Wrote: my mail.txt (saving the message to file) is this:

Which is completely messed up, because you are not setting up the TIdMessage correctly, not even close.

(08-27-2019, 02:33 PM)ccMcBride Wrote: ORGANIZER;CN=3DConnie M.:MAILTO:[weird that organizer name changed to start with 3D, but otherwise, same valie email address]

That is just part of how the Quoted-Printable encoding works.  '=' is a reserved character in QP, so it has to be escaped in hexadecimal format (the ASCII code for the '=' character is decimal 61, hex 0x3D). 'quoted-printable' is the default encoding for TIdText parts, whereas 'base64' is the default for TIdattachment....

(08-27-2019, 02:33 PM)ccMcBride Wrote: what I am getting in return :

 raised exception class EIdSMTPReplyError with message 'STOREDRV.submission.excetption : invalid recipentsException;
failed to process message due to a permanent exception with mesage.  Amessage can't be sent because it contains no recipients.  InvalidRecipientsException a message can't be sent because it contains no recipients. 

since I DO have a recipient, I'm not sure why I am getting this message.

You did not show the code that populates the recipient(s).  But the email you did show has no 'From' header in it.  Maybe that is what the server is actually complaining about? Hard to say since you did not show the actual SMTP commands being sent.

(08-27-2019, 02:33 PM)ccMcBride Wrote: any ideas what I am missing?

Per https://stackoverflow.com/a/19535685/65863, try something more like this instead when populating the TIdMessage:

Code:
dmEmail.emMessage.From.Address := ...;
dmEmail.emMessage.Recipients.EMailAddresses := ...;
...
dmEmail.emMessage.ContentType := 'multipart/mixed';
with TIdText.Create(dmEMail.emMessage.MessageParts) do
begin
  ContentType := 'multipart/alternative';
  //ParentPart := -1;
end;
with TIdText.Create(dmEMail.emMessage.MessageParts) do
begin
  ContentType := 'text/plain';
  Body.Text := 'some plain text here to describe the event for email readers that don't support iCalendar';
  ParentPart := 0;
end;
with TIdText.Create(dmEMail.emMessage.MessageParts) do
begin
  ContentType := 'text/calendar;method=REQUEST';
  Body.LoadFromFile(fName);
  ParentPart := 0;
end;
with TIdAttachmentFile.Create(dmEmail.emMessage.MessageParts, fName) do
begin
  ContentDisposition := 'attachment';
  ContentType := 'text/calendar;method=REQUEST';
  ContentID := ExtractFileName(fName);
  Filename := ExtractFilename(fName);
  //ParentPart := -1;
end;

Reply


Messages In This Thread
sending event email - by ccMcBride - 08-27-2019, 02:33 PM
RE: sending event email - by rlebeau - 08-27-2019, 06:19 PM
RE: sending event email - by ccMcBride - 08-28-2019, 02:30 PM
RE: sending event email - by rlebeau - 08-28-2019, 04:45 PM
RE: sending event email - by ccMcBride - 08-28-2019, 07:16 PM
RE: sending event email - by rlebeau - 08-28-2019, 08:19 PM
RE: sending event email - by ccMcBride - 08-29-2019, 03:12 PM
RE: sending event email - by rlebeau - 08-30-2019, 01:39 AM
RE: sending event email - by ccMcBride - 08-30-2019, 03:00 PM
RE: sending event email - by rlebeau - 08-30-2019, 05:30 PM
RE: sending event email - by ccMcBride - 09-03-2019, 05:46 PM
RE: sending event email - by rlebeau - 09-03-2019, 11:12 PM
RE: sending event email - by ccMcBride - 09-04-2019, 01:27 PM
RE: sending event email - by rlebeau - 09-04-2019, 07:46 PM
RE: sending event email - by ccMcBride - 09-05-2019, 03:07 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)