Send ics file RSVP format not working properly using Outlook smtp server?
I have a code that works well when using gmail smtp server with my personal credentials :
fun sendEventInvitation(from: Profile, to: Profile, meetup: Meetup) {
val message: MimeMessage = emailSender.createMimeMessage()
message.setFrom(InternetAddress("foo1@foo1.com"))
message.setRecipient(Message.RecipientType.TO, InternetAddress("foo2@foo2.com"))
message.subject = "foo"
val messageBodyEvent = MimeBodyPart()
val id = UUID.randomUUID().toString()
val eventIcs = formatCalendarFile(id, from, to, meetup)
messageBodyEvent.dataHandler = DataHandler(ByteArrayDataSource(eventIcs, "text/calendar; charset="utf-8"; method=REQUEST"))
messageBodyEvent.setHeader("Content-Transfer-Encoding", "base64")
val multiPart = MimeMultipart()
multiPart.addBodyPart(messageBodyEvent)
message.setContent(multiPart)
emailSender.send(message)
}
eventIcs
is basically a String
of an iCal correct format.
But whenever I switch to the outlook server using company's credentials, It gives the following error :
554 5.2.0 STOREDRV.Submission.Exception:InvalidRecipientsException; Failed to process message due to a permanent exception with message A message can't be sent because it contains no recipients. InvalidRecipientsException: A message can't be sent because it contains no recipients. [Hostname=AM6PR01MB5011.eurprd01.prod.exchangelabs.com]
DEBUG SMTP: got response code 554, with response: 554 5.2.0 STOREDRV.Submission.Exception:InvalidRecipientsException; Failed to process message due to a permanent exception with message A message can't be sent because it contains no recipients. InvalidRecipientsException: A message can't be sent because it contains no recipients. [Hostname=AM6PR01MB5011.eurprd01.prod.exchangelabs.com]
Now, weirdly enough, when I remove the method=REQUEST
attachment header :
messageBodyEvent.dataHandler = DataHandler(ByteArrayDataSource(eventIcs, "text/calendar; charset="utf-8"))
It works but because there's not this header, the ICS isn't well recognized by Outlook client and doesn't display RSVP options to the recipients as explained here.
I tried to send an invitation from Thunderbird using the same credentials and it works. So it's not link to rules whatsoever.
Here is the complete debug output :
DEBUG: JavaMail version 1.6.1
DEBUG: URL jar:file:/Users/baptistearnaud/.m2/repository/com/amazonaws/aws-java-sdk-ses/1.11.373/aws-java-sdk-ses-1.11.373.jar!/META-INF/javamail.providers
DEBUG: successfully loaded resource: jar:file:/Users/baptistearnaud/.m2/repository/com/amazonaws/aws-java-sdk-ses/1.11.373/aws-java-sdk-ses-1.11.373.jar!/META-INF/javamail.providers
DEBUG: successfully loaded resource: /META-INF/javamail.default.providers
DEBUG: Tables of loaded providers
DEBUG: Providers Listed By Class Name: {com.sun.mail.smtp.SMTPSSLTransport=javax.mail.Provider[TRANSPORT,smtps,com.sun.mail.smtp.SMTPSSLTransport,Oracle], com.sun.mail.smtp.SMTPTransport=javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Oracle], com.sun.mail.imap.IMAPSSLStore=javax.mail.Provider[STORE,imaps,com.sun.mail.imap.IMAPSSLStore,Oracle], com.sun.mail.pop3.POP3SSLStore=javax.mail.Provider[STORE,pop3s,com.sun.mail.pop3.POP3SSLStore,Oracle], com.sun.mail.imap.IMAPStore=javax.mail.Provider[STORE,imap,com.sun.mail.imap.IMAPStore,Oracle], com.sun.mail.pop3.POP3Store=javax.mail.Provider[STORE,pop3,com.sun.mail.pop3.POP3Store,Oracle], com.amazonaws.services.simpleemail.AWSJavaMailTransport=javax.mail.Provider[TRANSPORT,aws,com.amazonaws.services.simpleemail.AWSJavaMailTransport,Amazon Web Services LLC]}
DEBUG: Providers Listed By Protocol: {imaps=javax.mail.Provider[STORE,imaps,com.sun.mail.imap.IMAPSSLStore,Oracle], imap=javax.mail.Provider[STORE,imap,com.sun.mail.imap.IMAPStore,Oracle], smtps=javax.mail.Provider[TRANSPORT,smtps,com.sun.mail.smtp.SMTPSSLTransport,Oracle], pop3=javax.mail.Provider[STORE,pop3,com.sun.mail.pop3.POP3Store,Oracle], pop3s=javax.mail.Provider[STORE,pop3s,com.sun.mail.pop3.POP3SSLStore,Oracle], smtp=javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Oracle], aws=javax.mail.Provider[TRANSPORT,aws,com.amazonaws.services.simpleemail.AWSJavaMailTransport,Amazon Web Services LLC]}
DEBUG: successfully loaded resource: /META-INF/javamail.default.address.map
DEBUG: getProvider() returning javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Oracle]
DEBUG SMTP: useEhlo true, useAuth true
DEBUG SMTP: trying to connect to host "smtp.office365.com", port 587, isSSL false
220 LO2P265CA0439.outlook.office365.com Microsoft ESMTP MAIL Service ready at Wed, 21 Nov 2018 11:01:22 +0000
DEBUG SMTP: connected to host "smtp.office365.com", port: 587
EHLO mbp-de-baptiste.lan
250-LO2P265CA0439.outlook.office365.com Hello [89.227.204.114]
250-SIZE 157286400
250-PIPELINING
250-DSN
250-ENHANCEDSTATUSCODES
250-STARTTLS
250-8BITMIME
250-BINARYMIME
250-CHUNKING
250 SMTPUTF8
DEBUG SMTP: Found extension "SIZE", arg "157286400"
DEBUG SMTP: Found extension "PIPELINING", arg ""
DEBUG SMTP: Found extension "DSN", arg ""
DEBUG SMTP: Found extension "ENHANCEDSTATUSCODES", arg ""
DEBUG SMTP: Found extension "STARTTLS", arg ""
DEBUG SMTP: Found extension "8BITMIME", arg ""
DEBUG SMTP: Found extension "BINARYMIME", arg ""
DEBUG SMTP: Found extension "CHUNKING", arg ""
DEBUG SMTP: Found extension "SMTPUTF8", arg ""
STARTTLS
220 2.0.0 SMTP server ready
EHLO mbp-de-baptiste.lan
250-LO2P265CA0439.outlook.office365.com Hello [89.227.204.114]
250-SIZE 157286400
250-PIPELINING
250-DSN
250-ENHANCEDSTATUSCODES
250-AUTH LOGIN XOAUTH2
250-8BITMIME
250-BINARYMIME
250-CHUNKING
250 SMTPUTF8
DEBUG SMTP: Found extension "SIZE", arg "157286400"
DEBUG SMTP: Found extension "PIPELINING", arg ""
DEBUG SMTP: Found extension "DSN", arg ""
DEBUG SMTP: Found extension "ENHANCEDSTATUSCODES", arg ""
DEBUG SMTP: Found extension "AUTH", arg "LOGIN XOAUTH2"
DEBUG SMTP: Found extension "8BITMIME", arg ""
DEBUG SMTP: Found extension "BINARYMIME", arg ""
DEBUG SMTP: Found extension "CHUNKING", arg ""
DEBUG SMTP: Found extension "SMTPUTF8", arg ""
DEBUG SMTP: protocolConnect login, host=smtp.office365.com, user=SVC_ToGazer@uccint.onmicrosoft.com, password=<non-null>
DEBUG SMTP: Attempt to authenticate using mechanisms: LOGIN PLAIN DIGEST-MD5 NTLM XOAUTH2
DEBUG SMTP: Using mechanism LOGIN
DEBUG SMTP: AUTH LOGIN command trace suppressed
DEBUG SMTP: AUTH LOGIN succeeded
DEBUG SMTP: use8bit false
MAIL FROM:<foo1@foo1.com>
250 2.1.0 Sender OK
RCPT TO:<foo2@foo2.com>
250 2.1.5 Recipient OK
DEBUG SMTP: Verified Addresses
DEBUG SMTP: foo2@foo2.com
DATA
354 Start mail input; end with <CRLF>.<CRLF>
Date: Wed, 21 Nov 2018 11:00:41 +0000 (UTC)
From: foo1@foo1.com
To: foo2@foo2.com
Message-ID: <681000169.0.1542798041668@mbp-de-baptiste.lan>
Subject: FOO
MIME-Version: 1.0
Content-Type: multipart/mixed;
boundary="----=_Part_1_1921144901.1542798041673"
------=_Part_1_1921144901.1542798041673
Content-Type: text/calendar; charset="utf-8"; method=REQUEST
Content-Transfer-Encoding: base64
QkVHSU46VkNBTEVOREFSClZFUlNJT046Mi4wClBST0RJRDotLy9HUlRnYXogQ29ycG9yYXRpb24v
L05PTlNHTUwgVG9nYXonZXIvL0ZSCk1FVEhPRDpSRVFVRVNUCkJFR0lOOlZFVkVOVApVSUQ6YTQ5
ODVkZjUtNzI1YS00NTA0LTgzNWYtZDhkNTU2ZjliMDIzQHRvZ2F6ZXIuY29tCkRUU1RBTVA6MjAx
ODExMjlUMTgwMDAwWgpPUkdBTklaRVI7Q049dG9nYXplckBpbnQuZ3J0Z2F6LmV1Om1haWx0bzp0
b2dhemVyQGludC5ncnRnYXouZXUKQVRURU5ERUU7Q1VUWVBFPUlORElWSURVQUw7Uk9MRT1SRVEt
UEFSVElDSVBBTlQ7ClBBUlRTVEFUPU5FRURTLUFDVElPTjtSU1ZQPVRSVUU7Q049QmFwdGlzdGUg
QXJuYXVkOwpYLU5VTS1HVUVTVFM9MDptYWlsdG86YmFwdF9pczJAaG90bWFpbC5jb20KRFRTVEFS
VDoyMDE4MTEyOVQxODAwMDAKRFRFTkQ6MjAxODExMjlUMjIwMDAwClNVTU1BUlk6QWZ0ZXJ3b3Jr
IGdheidwYWNobwpMT0NBVElPTjpQYXJpcyA4ZSBhcnIKREVTQ1JJUFRJT046QWZ0ZXJ3b3JrIG/D
uSBsJ29uIHZhIGTDqWd1c3RlciBkdSBib24gZ2FzcGFjaG8uIEonZXNww6hyZSBxdWUgbGUgamV1
IGRlIG1vdCB2b3VzIHBsYcOudC4uLiBFeGNlbGxlbnQhCkVORDpWRVZFTlQKRU5EOlZDQUxFTkRB
Ugo=
------=_Part_1_1921144901.1542798041673--
.
554 5.2.0 STOREDRV.Submission.Exception:InvalidRecipientsException; Failed to process message due to a permanent exception with message A message can't be sent because it contains no recipients. InvalidRecipientsException: A message can't be sent because it contains no recipients. [Hostname=AM6PR01MB5011.eurprd01.prod.exchangelabs.com]
DEBUG SMTP: got response code 554, with response: 554 5.2.0 STOREDRV.Submission.Exception:InvalidRecipientsException; Failed to process message due to a permanent exception with message A message can't be sent because it contains no recipients. InvalidRecipientsException: A message can't be sent because it contains no recipients. [Hostname=AM6PR01MB5011.eurprd01.prod.exchangelabs.com]
RSET
250 2.0.0 Resetting
DEBUG SMTP: MessagingException while sending, THROW:
com.sun.mail.smtp.SMTPSendFailedException: 554 5.2.0 STOREDRV.Submission.Exception:InvalidRecipientsException; Failed to process message due to a permanent exception with message A message can't be sent because it contains no recipients. InvalidRecipientsException: A message can't be sent because it contains no recipients. [Hostname=AM6PR01MB5011.eurprd01.prod.exchangelabs.com]
Any ideas why there is this behavior ?
email kotlin outlook javamail icalendar
add a comment |
I have a code that works well when using gmail smtp server with my personal credentials :
fun sendEventInvitation(from: Profile, to: Profile, meetup: Meetup) {
val message: MimeMessage = emailSender.createMimeMessage()
message.setFrom(InternetAddress("foo1@foo1.com"))
message.setRecipient(Message.RecipientType.TO, InternetAddress("foo2@foo2.com"))
message.subject = "foo"
val messageBodyEvent = MimeBodyPart()
val id = UUID.randomUUID().toString()
val eventIcs = formatCalendarFile(id, from, to, meetup)
messageBodyEvent.dataHandler = DataHandler(ByteArrayDataSource(eventIcs, "text/calendar; charset="utf-8"; method=REQUEST"))
messageBodyEvent.setHeader("Content-Transfer-Encoding", "base64")
val multiPart = MimeMultipart()
multiPart.addBodyPart(messageBodyEvent)
message.setContent(multiPart)
emailSender.send(message)
}
eventIcs
is basically a String
of an iCal correct format.
But whenever I switch to the outlook server using company's credentials, It gives the following error :
554 5.2.0 STOREDRV.Submission.Exception:InvalidRecipientsException; Failed to process message due to a permanent exception with message A message can't be sent because it contains no recipients. InvalidRecipientsException: A message can't be sent because it contains no recipients. [Hostname=AM6PR01MB5011.eurprd01.prod.exchangelabs.com]
DEBUG SMTP: got response code 554, with response: 554 5.2.0 STOREDRV.Submission.Exception:InvalidRecipientsException; Failed to process message due to a permanent exception with message A message can't be sent because it contains no recipients. InvalidRecipientsException: A message can't be sent because it contains no recipients. [Hostname=AM6PR01MB5011.eurprd01.prod.exchangelabs.com]
Now, weirdly enough, when I remove the method=REQUEST
attachment header :
messageBodyEvent.dataHandler = DataHandler(ByteArrayDataSource(eventIcs, "text/calendar; charset="utf-8"))
It works but because there's not this header, the ICS isn't well recognized by Outlook client and doesn't display RSVP options to the recipients as explained here.
I tried to send an invitation from Thunderbird using the same credentials and it works. So it's not link to rules whatsoever.
Here is the complete debug output :
DEBUG: JavaMail version 1.6.1
DEBUG: URL jar:file:/Users/baptistearnaud/.m2/repository/com/amazonaws/aws-java-sdk-ses/1.11.373/aws-java-sdk-ses-1.11.373.jar!/META-INF/javamail.providers
DEBUG: successfully loaded resource: jar:file:/Users/baptistearnaud/.m2/repository/com/amazonaws/aws-java-sdk-ses/1.11.373/aws-java-sdk-ses-1.11.373.jar!/META-INF/javamail.providers
DEBUG: successfully loaded resource: /META-INF/javamail.default.providers
DEBUG: Tables of loaded providers
DEBUG: Providers Listed By Class Name: {com.sun.mail.smtp.SMTPSSLTransport=javax.mail.Provider[TRANSPORT,smtps,com.sun.mail.smtp.SMTPSSLTransport,Oracle], com.sun.mail.smtp.SMTPTransport=javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Oracle], com.sun.mail.imap.IMAPSSLStore=javax.mail.Provider[STORE,imaps,com.sun.mail.imap.IMAPSSLStore,Oracle], com.sun.mail.pop3.POP3SSLStore=javax.mail.Provider[STORE,pop3s,com.sun.mail.pop3.POP3SSLStore,Oracle], com.sun.mail.imap.IMAPStore=javax.mail.Provider[STORE,imap,com.sun.mail.imap.IMAPStore,Oracle], com.sun.mail.pop3.POP3Store=javax.mail.Provider[STORE,pop3,com.sun.mail.pop3.POP3Store,Oracle], com.amazonaws.services.simpleemail.AWSJavaMailTransport=javax.mail.Provider[TRANSPORT,aws,com.amazonaws.services.simpleemail.AWSJavaMailTransport,Amazon Web Services LLC]}
DEBUG: Providers Listed By Protocol: {imaps=javax.mail.Provider[STORE,imaps,com.sun.mail.imap.IMAPSSLStore,Oracle], imap=javax.mail.Provider[STORE,imap,com.sun.mail.imap.IMAPStore,Oracle], smtps=javax.mail.Provider[TRANSPORT,smtps,com.sun.mail.smtp.SMTPSSLTransport,Oracle], pop3=javax.mail.Provider[STORE,pop3,com.sun.mail.pop3.POP3Store,Oracle], pop3s=javax.mail.Provider[STORE,pop3s,com.sun.mail.pop3.POP3SSLStore,Oracle], smtp=javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Oracle], aws=javax.mail.Provider[TRANSPORT,aws,com.amazonaws.services.simpleemail.AWSJavaMailTransport,Amazon Web Services LLC]}
DEBUG: successfully loaded resource: /META-INF/javamail.default.address.map
DEBUG: getProvider() returning javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Oracle]
DEBUG SMTP: useEhlo true, useAuth true
DEBUG SMTP: trying to connect to host "smtp.office365.com", port 587, isSSL false
220 LO2P265CA0439.outlook.office365.com Microsoft ESMTP MAIL Service ready at Wed, 21 Nov 2018 11:01:22 +0000
DEBUG SMTP: connected to host "smtp.office365.com", port: 587
EHLO mbp-de-baptiste.lan
250-LO2P265CA0439.outlook.office365.com Hello [89.227.204.114]
250-SIZE 157286400
250-PIPELINING
250-DSN
250-ENHANCEDSTATUSCODES
250-STARTTLS
250-8BITMIME
250-BINARYMIME
250-CHUNKING
250 SMTPUTF8
DEBUG SMTP: Found extension "SIZE", arg "157286400"
DEBUG SMTP: Found extension "PIPELINING", arg ""
DEBUG SMTP: Found extension "DSN", arg ""
DEBUG SMTP: Found extension "ENHANCEDSTATUSCODES", arg ""
DEBUG SMTP: Found extension "STARTTLS", arg ""
DEBUG SMTP: Found extension "8BITMIME", arg ""
DEBUG SMTP: Found extension "BINARYMIME", arg ""
DEBUG SMTP: Found extension "CHUNKING", arg ""
DEBUG SMTP: Found extension "SMTPUTF8", arg ""
STARTTLS
220 2.0.0 SMTP server ready
EHLO mbp-de-baptiste.lan
250-LO2P265CA0439.outlook.office365.com Hello [89.227.204.114]
250-SIZE 157286400
250-PIPELINING
250-DSN
250-ENHANCEDSTATUSCODES
250-AUTH LOGIN XOAUTH2
250-8BITMIME
250-BINARYMIME
250-CHUNKING
250 SMTPUTF8
DEBUG SMTP: Found extension "SIZE", arg "157286400"
DEBUG SMTP: Found extension "PIPELINING", arg ""
DEBUG SMTP: Found extension "DSN", arg ""
DEBUG SMTP: Found extension "ENHANCEDSTATUSCODES", arg ""
DEBUG SMTP: Found extension "AUTH", arg "LOGIN XOAUTH2"
DEBUG SMTP: Found extension "8BITMIME", arg ""
DEBUG SMTP: Found extension "BINARYMIME", arg ""
DEBUG SMTP: Found extension "CHUNKING", arg ""
DEBUG SMTP: Found extension "SMTPUTF8", arg ""
DEBUG SMTP: protocolConnect login, host=smtp.office365.com, user=SVC_ToGazer@uccint.onmicrosoft.com, password=<non-null>
DEBUG SMTP: Attempt to authenticate using mechanisms: LOGIN PLAIN DIGEST-MD5 NTLM XOAUTH2
DEBUG SMTP: Using mechanism LOGIN
DEBUG SMTP: AUTH LOGIN command trace suppressed
DEBUG SMTP: AUTH LOGIN succeeded
DEBUG SMTP: use8bit false
MAIL FROM:<foo1@foo1.com>
250 2.1.0 Sender OK
RCPT TO:<foo2@foo2.com>
250 2.1.5 Recipient OK
DEBUG SMTP: Verified Addresses
DEBUG SMTP: foo2@foo2.com
DATA
354 Start mail input; end with <CRLF>.<CRLF>
Date: Wed, 21 Nov 2018 11:00:41 +0000 (UTC)
From: foo1@foo1.com
To: foo2@foo2.com
Message-ID: <681000169.0.1542798041668@mbp-de-baptiste.lan>
Subject: FOO
MIME-Version: 1.0
Content-Type: multipart/mixed;
boundary="----=_Part_1_1921144901.1542798041673"
------=_Part_1_1921144901.1542798041673
Content-Type: text/calendar; charset="utf-8"; method=REQUEST
Content-Transfer-Encoding: base64
QkVHSU46VkNBTEVOREFSClZFUlNJT046Mi4wClBST0RJRDotLy9HUlRnYXogQ29ycG9yYXRpb24v
L05PTlNHTUwgVG9nYXonZXIvL0ZSCk1FVEhPRDpSRVFVRVNUCkJFR0lOOlZFVkVOVApVSUQ6YTQ5
ODVkZjUtNzI1YS00NTA0LTgzNWYtZDhkNTU2ZjliMDIzQHRvZ2F6ZXIuY29tCkRUU1RBTVA6MjAx
ODExMjlUMTgwMDAwWgpPUkdBTklaRVI7Q049dG9nYXplckBpbnQuZ3J0Z2F6LmV1Om1haWx0bzp0
b2dhemVyQGludC5ncnRnYXouZXUKQVRURU5ERUU7Q1VUWVBFPUlORElWSURVQUw7Uk9MRT1SRVEt
UEFSVElDSVBBTlQ7ClBBUlRTVEFUPU5FRURTLUFDVElPTjtSU1ZQPVRSVUU7Q049QmFwdGlzdGUg
QXJuYXVkOwpYLU5VTS1HVUVTVFM9MDptYWlsdG86YmFwdF9pczJAaG90bWFpbC5jb20KRFRTVEFS
VDoyMDE4MTEyOVQxODAwMDAKRFRFTkQ6MjAxODExMjlUMjIwMDAwClNVTU1BUlk6QWZ0ZXJ3b3Jr
IGdheidwYWNobwpMT0NBVElPTjpQYXJpcyA4ZSBhcnIKREVTQ1JJUFRJT046QWZ0ZXJ3b3JrIG/D
uSBsJ29uIHZhIGTDqWd1c3RlciBkdSBib24gZ2FzcGFjaG8uIEonZXNww6hyZSBxdWUgbGUgamV1
IGRlIG1vdCB2b3VzIHBsYcOudC4uLiBFeGNlbGxlbnQhCkVORDpWRVZFTlQKRU5EOlZDQUxFTkRB
Ugo=
------=_Part_1_1921144901.1542798041673--
.
554 5.2.0 STOREDRV.Submission.Exception:InvalidRecipientsException; Failed to process message due to a permanent exception with message A message can't be sent because it contains no recipients. InvalidRecipientsException: A message can't be sent because it contains no recipients. [Hostname=AM6PR01MB5011.eurprd01.prod.exchangelabs.com]
DEBUG SMTP: got response code 554, with response: 554 5.2.0 STOREDRV.Submission.Exception:InvalidRecipientsException; Failed to process message due to a permanent exception with message A message can't be sent because it contains no recipients. InvalidRecipientsException: A message can't be sent because it contains no recipients. [Hostname=AM6PR01MB5011.eurprd01.prod.exchangelabs.com]
RSET
250 2.0.0 Resetting
DEBUG SMTP: MessagingException while sending, THROW:
com.sun.mail.smtp.SMTPSendFailedException: 554 5.2.0 STOREDRV.Submission.Exception:InvalidRecipientsException; Failed to process message due to a permanent exception with message A message can't be sent because it contains no recipients. InvalidRecipientsException: A message can't be sent because it contains no recipients. [Hostname=AM6PR01MB5011.eurprd01.prod.exchangelabs.com]
Any ideas why there is this behavior ?
email kotlin outlook javamail icalendar
That's pretty weird. You message clearly has recipients so that's not what it's complaining about. The fact that the message is delivered when you remove method=REQUEST suggests that it's complaining about something in the calendar appointment. Should the calendar appointment also mention foo2@foo2.com somehow? Maybe the invitation needs to mention the person you're sending the message to?
– Bill Shannon
Nov 21 '18 at 21:17
The person email is mentioned in the invitation as an attendee so that's not the problem... I'll try to focus my debug in the calendar. Thanks for the suggestion!
– Baptiste Arnaud
Nov 21 '18 at 21:20
add a comment |
I have a code that works well when using gmail smtp server with my personal credentials :
fun sendEventInvitation(from: Profile, to: Profile, meetup: Meetup) {
val message: MimeMessage = emailSender.createMimeMessage()
message.setFrom(InternetAddress("foo1@foo1.com"))
message.setRecipient(Message.RecipientType.TO, InternetAddress("foo2@foo2.com"))
message.subject = "foo"
val messageBodyEvent = MimeBodyPart()
val id = UUID.randomUUID().toString()
val eventIcs = formatCalendarFile(id, from, to, meetup)
messageBodyEvent.dataHandler = DataHandler(ByteArrayDataSource(eventIcs, "text/calendar; charset="utf-8"; method=REQUEST"))
messageBodyEvent.setHeader("Content-Transfer-Encoding", "base64")
val multiPart = MimeMultipart()
multiPart.addBodyPart(messageBodyEvent)
message.setContent(multiPart)
emailSender.send(message)
}
eventIcs
is basically a String
of an iCal correct format.
But whenever I switch to the outlook server using company's credentials, It gives the following error :
554 5.2.0 STOREDRV.Submission.Exception:InvalidRecipientsException; Failed to process message due to a permanent exception with message A message can't be sent because it contains no recipients. InvalidRecipientsException: A message can't be sent because it contains no recipients. [Hostname=AM6PR01MB5011.eurprd01.prod.exchangelabs.com]
DEBUG SMTP: got response code 554, with response: 554 5.2.0 STOREDRV.Submission.Exception:InvalidRecipientsException; Failed to process message due to a permanent exception with message A message can't be sent because it contains no recipients. InvalidRecipientsException: A message can't be sent because it contains no recipients. [Hostname=AM6PR01MB5011.eurprd01.prod.exchangelabs.com]
Now, weirdly enough, when I remove the method=REQUEST
attachment header :
messageBodyEvent.dataHandler = DataHandler(ByteArrayDataSource(eventIcs, "text/calendar; charset="utf-8"))
It works but because there's not this header, the ICS isn't well recognized by Outlook client and doesn't display RSVP options to the recipients as explained here.
I tried to send an invitation from Thunderbird using the same credentials and it works. So it's not link to rules whatsoever.
Here is the complete debug output :
DEBUG: JavaMail version 1.6.1
DEBUG: URL jar:file:/Users/baptistearnaud/.m2/repository/com/amazonaws/aws-java-sdk-ses/1.11.373/aws-java-sdk-ses-1.11.373.jar!/META-INF/javamail.providers
DEBUG: successfully loaded resource: jar:file:/Users/baptistearnaud/.m2/repository/com/amazonaws/aws-java-sdk-ses/1.11.373/aws-java-sdk-ses-1.11.373.jar!/META-INF/javamail.providers
DEBUG: successfully loaded resource: /META-INF/javamail.default.providers
DEBUG: Tables of loaded providers
DEBUG: Providers Listed By Class Name: {com.sun.mail.smtp.SMTPSSLTransport=javax.mail.Provider[TRANSPORT,smtps,com.sun.mail.smtp.SMTPSSLTransport,Oracle], com.sun.mail.smtp.SMTPTransport=javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Oracle], com.sun.mail.imap.IMAPSSLStore=javax.mail.Provider[STORE,imaps,com.sun.mail.imap.IMAPSSLStore,Oracle], com.sun.mail.pop3.POP3SSLStore=javax.mail.Provider[STORE,pop3s,com.sun.mail.pop3.POP3SSLStore,Oracle], com.sun.mail.imap.IMAPStore=javax.mail.Provider[STORE,imap,com.sun.mail.imap.IMAPStore,Oracle], com.sun.mail.pop3.POP3Store=javax.mail.Provider[STORE,pop3,com.sun.mail.pop3.POP3Store,Oracle], com.amazonaws.services.simpleemail.AWSJavaMailTransport=javax.mail.Provider[TRANSPORT,aws,com.amazonaws.services.simpleemail.AWSJavaMailTransport,Amazon Web Services LLC]}
DEBUG: Providers Listed By Protocol: {imaps=javax.mail.Provider[STORE,imaps,com.sun.mail.imap.IMAPSSLStore,Oracle], imap=javax.mail.Provider[STORE,imap,com.sun.mail.imap.IMAPStore,Oracle], smtps=javax.mail.Provider[TRANSPORT,smtps,com.sun.mail.smtp.SMTPSSLTransport,Oracle], pop3=javax.mail.Provider[STORE,pop3,com.sun.mail.pop3.POP3Store,Oracle], pop3s=javax.mail.Provider[STORE,pop3s,com.sun.mail.pop3.POP3SSLStore,Oracle], smtp=javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Oracle], aws=javax.mail.Provider[TRANSPORT,aws,com.amazonaws.services.simpleemail.AWSJavaMailTransport,Amazon Web Services LLC]}
DEBUG: successfully loaded resource: /META-INF/javamail.default.address.map
DEBUG: getProvider() returning javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Oracle]
DEBUG SMTP: useEhlo true, useAuth true
DEBUG SMTP: trying to connect to host "smtp.office365.com", port 587, isSSL false
220 LO2P265CA0439.outlook.office365.com Microsoft ESMTP MAIL Service ready at Wed, 21 Nov 2018 11:01:22 +0000
DEBUG SMTP: connected to host "smtp.office365.com", port: 587
EHLO mbp-de-baptiste.lan
250-LO2P265CA0439.outlook.office365.com Hello [89.227.204.114]
250-SIZE 157286400
250-PIPELINING
250-DSN
250-ENHANCEDSTATUSCODES
250-STARTTLS
250-8BITMIME
250-BINARYMIME
250-CHUNKING
250 SMTPUTF8
DEBUG SMTP: Found extension "SIZE", arg "157286400"
DEBUG SMTP: Found extension "PIPELINING", arg ""
DEBUG SMTP: Found extension "DSN", arg ""
DEBUG SMTP: Found extension "ENHANCEDSTATUSCODES", arg ""
DEBUG SMTP: Found extension "STARTTLS", arg ""
DEBUG SMTP: Found extension "8BITMIME", arg ""
DEBUG SMTP: Found extension "BINARYMIME", arg ""
DEBUG SMTP: Found extension "CHUNKING", arg ""
DEBUG SMTP: Found extension "SMTPUTF8", arg ""
STARTTLS
220 2.0.0 SMTP server ready
EHLO mbp-de-baptiste.lan
250-LO2P265CA0439.outlook.office365.com Hello [89.227.204.114]
250-SIZE 157286400
250-PIPELINING
250-DSN
250-ENHANCEDSTATUSCODES
250-AUTH LOGIN XOAUTH2
250-8BITMIME
250-BINARYMIME
250-CHUNKING
250 SMTPUTF8
DEBUG SMTP: Found extension "SIZE", arg "157286400"
DEBUG SMTP: Found extension "PIPELINING", arg ""
DEBUG SMTP: Found extension "DSN", arg ""
DEBUG SMTP: Found extension "ENHANCEDSTATUSCODES", arg ""
DEBUG SMTP: Found extension "AUTH", arg "LOGIN XOAUTH2"
DEBUG SMTP: Found extension "8BITMIME", arg ""
DEBUG SMTP: Found extension "BINARYMIME", arg ""
DEBUG SMTP: Found extension "CHUNKING", arg ""
DEBUG SMTP: Found extension "SMTPUTF8", arg ""
DEBUG SMTP: protocolConnect login, host=smtp.office365.com, user=SVC_ToGazer@uccint.onmicrosoft.com, password=<non-null>
DEBUG SMTP: Attempt to authenticate using mechanisms: LOGIN PLAIN DIGEST-MD5 NTLM XOAUTH2
DEBUG SMTP: Using mechanism LOGIN
DEBUG SMTP: AUTH LOGIN command trace suppressed
DEBUG SMTP: AUTH LOGIN succeeded
DEBUG SMTP: use8bit false
MAIL FROM:<foo1@foo1.com>
250 2.1.0 Sender OK
RCPT TO:<foo2@foo2.com>
250 2.1.5 Recipient OK
DEBUG SMTP: Verified Addresses
DEBUG SMTP: foo2@foo2.com
DATA
354 Start mail input; end with <CRLF>.<CRLF>
Date: Wed, 21 Nov 2018 11:00:41 +0000 (UTC)
From: foo1@foo1.com
To: foo2@foo2.com
Message-ID: <681000169.0.1542798041668@mbp-de-baptiste.lan>
Subject: FOO
MIME-Version: 1.0
Content-Type: multipart/mixed;
boundary="----=_Part_1_1921144901.1542798041673"
------=_Part_1_1921144901.1542798041673
Content-Type: text/calendar; charset="utf-8"; method=REQUEST
Content-Transfer-Encoding: base64
QkVHSU46VkNBTEVOREFSClZFUlNJT046Mi4wClBST0RJRDotLy9HUlRnYXogQ29ycG9yYXRpb24v
L05PTlNHTUwgVG9nYXonZXIvL0ZSCk1FVEhPRDpSRVFVRVNUCkJFR0lOOlZFVkVOVApVSUQ6YTQ5
ODVkZjUtNzI1YS00NTA0LTgzNWYtZDhkNTU2ZjliMDIzQHRvZ2F6ZXIuY29tCkRUU1RBTVA6MjAx
ODExMjlUMTgwMDAwWgpPUkdBTklaRVI7Q049dG9nYXplckBpbnQuZ3J0Z2F6LmV1Om1haWx0bzp0
b2dhemVyQGludC5ncnRnYXouZXUKQVRURU5ERUU7Q1VUWVBFPUlORElWSURVQUw7Uk9MRT1SRVEt
UEFSVElDSVBBTlQ7ClBBUlRTVEFUPU5FRURTLUFDVElPTjtSU1ZQPVRSVUU7Q049QmFwdGlzdGUg
QXJuYXVkOwpYLU5VTS1HVUVTVFM9MDptYWlsdG86YmFwdF9pczJAaG90bWFpbC5jb20KRFRTVEFS
VDoyMDE4MTEyOVQxODAwMDAKRFRFTkQ6MjAxODExMjlUMjIwMDAwClNVTU1BUlk6QWZ0ZXJ3b3Jr
IGdheidwYWNobwpMT0NBVElPTjpQYXJpcyA4ZSBhcnIKREVTQ1JJUFRJT046QWZ0ZXJ3b3JrIG/D
uSBsJ29uIHZhIGTDqWd1c3RlciBkdSBib24gZ2FzcGFjaG8uIEonZXNww6hyZSBxdWUgbGUgamV1
IGRlIG1vdCB2b3VzIHBsYcOudC4uLiBFeGNlbGxlbnQhCkVORDpWRVZFTlQKRU5EOlZDQUxFTkRB
Ugo=
------=_Part_1_1921144901.1542798041673--
.
554 5.2.0 STOREDRV.Submission.Exception:InvalidRecipientsException; Failed to process message due to a permanent exception with message A message can't be sent because it contains no recipients. InvalidRecipientsException: A message can't be sent because it contains no recipients. [Hostname=AM6PR01MB5011.eurprd01.prod.exchangelabs.com]
DEBUG SMTP: got response code 554, with response: 554 5.2.0 STOREDRV.Submission.Exception:InvalidRecipientsException; Failed to process message due to a permanent exception with message A message can't be sent because it contains no recipients. InvalidRecipientsException: A message can't be sent because it contains no recipients. [Hostname=AM6PR01MB5011.eurprd01.prod.exchangelabs.com]
RSET
250 2.0.0 Resetting
DEBUG SMTP: MessagingException while sending, THROW:
com.sun.mail.smtp.SMTPSendFailedException: 554 5.2.0 STOREDRV.Submission.Exception:InvalidRecipientsException; Failed to process message due to a permanent exception with message A message can't be sent because it contains no recipients. InvalidRecipientsException: A message can't be sent because it contains no recipients. [Hostname=AM6PR01MB5011.eurprd01.prod.exchangelabs.com]
Any ideas why there is this behavior ?
email kotlin outlook javamail icalendar
I have a code that works well when using gmail smtp server with my personal credentials :
fun sendEventInvitation(from: Profile, to: Profile, meetup: Meetup) {
val message: MimeMessage = emailSender.createMimeMessage()
message.setFrom(InternetAddress("foo1@foo1.com"))
message.setRecipient(Message.RecipientType.TO, InternetAddress("foo2@foo2.com"))
message.subject = "foo"
val messageBodyEvent = MimeBodyPart()
val id = UUID.randomUUID().toString()
val eventIcs = formatCalendarFile(id, from, to, meetup)
messageBodyEvent.dataHandler = DataHandler(ByteArrayDataSource(eventIcs, "text/calendar; charset="utf-8"; method=REQUEST"))
messageBodyEvent.setHeader("Content-Transfer-Encoding", "base64")
val multiPart = MimeMultipart()
multiPart.addBodyPart(messageBodyEvent)
message.setContent(multiPart)
emailSender.send(message)
}
eventIcs
is basically a String
of an iCal correct format.
But whenever I switch to the outlook server using company's credentials, It gives the following error :
554 5.2.0 STOREDRV.Submission.Exception:InvalidRecipientsException; Failed to process message due to a permanent exception with message A message can't be sent because it contains no recipients. InvalidRecipientsException: A message can't be sent because it contains no recipients. [Hostname=AM6PR01MB5011.eurprd01.prod.exchangelabs.com]
DEBUG SMTP: got response code 554, with response: 554 5.2.0 STOREDRV.Submission.Exception:InvalidRecipientsException; Failed to process message due to a permanent exception with message A message can't be sent because it contains no recipients. InvalidRecipientsException: A message can't be sent because it contains no recipients. [Hostname=AM6PR01MB5011.eurprd01.prod.exchangelabs.com]
Now, weirdly enough, when I remove the method=REQUEST
attachment header :
messageBodyEvent.dataHandler = DataHandler(ByteArrayDataSource(eventIcs, "text/calendar; charset="utf-8"))
It works but because there's not this header, the ICS isn't well recognized by Outlook client and doesn't display RSVP options to the recipients as explained here.
I tried to send an invitation from Thunderbird using the same credentials and it works. So it's not link to rules whatsoever.
Here is the complete debug output :
DEBUG: JavaMail version 1.6.1
DEBUG: URL jar:file:/Users/baptistearnaud/.m2/repository/com/amazonaws/aws-java-sdk-ses/1.11.373/aws-java-sdk-ses-1.11.373.jar!/META-INF/javamail.providers
DEBUG: successfully loaded resource: jar:file:/Users/baptistearnaud/.m2/repository/com/amazonaws/aws-java-sdk-ses/1.11.373/aws-java-sdk-ses-1.11.373.jar!/META-INF/javamail.providers
DEBUG: successfully loaded resource: /META-INF/javamail.default.providers
DEBUG: Tables of loaded providers
DEBUG: Providers Listed By Class Name: {com.sun.mail.smtp.SMTPSSLTransport=javax.mail.Provider[TRANSPORT,smtps,com.sun.mail.smtp.SMTPSSLTransport,Oracle], com.sun.mail.smtp.SMTPTransport=javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Oracle], com.sun.mail.imap.IMAPSSLStore=javax.mail.Provider[STORE,imaps,com.sun.mail.imap.IMAPSSLStore,Oracle], com.sun.mail.pop3.POP3SSLStore=javax.mail.Provider[STORE,pop3s,com.sun.mail.pop3.POP3SSLStore,Oracle], com.sun.mail.imap.IMAPStore=javax.mail.Provider[STORE,imap,com.sun.mail.imap.IMAPStore,Oracle], com.sun.mail.pop3.POP3Store=javax.mail.Provider[STORE,pop3,com.sun.mail.pop3.POP3Store,Oracle], com.amazonaws.services.simpleemail.AWSJavaMailTransport=javax.mail.Provider[TRANSPORT,aws,com.amazonaws.services.simpleemail.AWSJavaMailTransport,Amazon Web Services LLC]}
DEBUG: Providers Listed By Protocol: {imaps=javax.mail.Provider[STORE,imaps,com.sun.mail.imap.IMAPSSLStore,Oracle], imap=javax.mail.Provider[STORE,imap,com.sun.mail.imap.IMAPStore,Oracle], smtps=javax.mail.Provider[TRANSPORT,smtps,com.sun.mail.smtp.SMTPSSLTransport,Oracle], pop3=javax.mail.Provider[STORE,pop3,com.sun.mail.pop3.POP3Store,Oracle], pop3s=javax.mail.Provider[STORE,pop3s,com.sun.mail.pop3.POP3SSLStore,Oracle], smtp=javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Oracle], aws=javax.mail.Provider[TRANSPORT,aws,com.amazonaws.services.simpleemail.AWSJavaMailTransport,Amazon Web Services LLC]}
DEBUG: successfully loaded resource: /META-INF/javamail.default.address.map
DEBUG: getProvider() returning javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Oracle]
DEBUG SMTP: useEhlo true, useAuth true
DEBUG SMTP: trying to connect to host "smtp.office365.com", port 587, isSSL false
220 LO2P265CA0439.outlook.office365.com Microsoft ESMTP MAIL Service ready at Wed, 21 Nov 2018 11:01:22 +0000
DEBUG SMTP: connected to host "smtp.office365.com", port: 587
EHLO mbp-de-baptiste.lan
250-LO2P265CA0439.outlook.office365.com Hello [89.227.204.114]
250-SIZE 157286400
250-PIPELINING
250-DSN
250-ENHANCEDSTATUSCODES
250-STARTTLS
250-8BITMIME
250-BINARYMIME
250-CHUNKING
250 SMTPUTF8
DEBUG SMTP: Found extension "SIZE", arg "157286400"
DEBUG SMTP: Found extension "PIPELINING", arg ""
DEBUG SMTP: Found extension "DSN", arg ""
DEBUG SMTP: Found extension "ENHANCEDSTATUSCODES", arg ""
DEBUG SMTP: Found extension "STARTTLS", arg ""
DEBUG SMTP: Found extension "8BITMIME", arg ""
DEBUG SMTP: Found extension "BINARYMIME", arg ""
DEBUG SMTP: Found extension "CHUNKING", arg ""
DEBUG SMTP: Found extension "SMTPUTF8", arg ""
STARTTLS
220 2.0.0 SMTP server ready
EHLO mbp-de-baptiste.lan
250-LO2P265CA0439.outlook.office365.com Hello [89.227.204.114]
250-SIZE 157286400
250-PIPELINING
250-DSN
250-ENHANCEDSTATUSCODES
250-AUTH LOGIN XOAUTH2
250-8BITMIME
250-BINARYMIME
250-CHUNKING
250 SMTPUTF8
DEBUG SMTP: Found extension "SIZE", arg "157286400"
DEBUG SMTP: Found extension "PIPELINING", arg ""
DEBUG SMTP: Found extension "DSN", arg ""
DEBUG SMTP: Found extension "ENHANCEDSTATUSCODES", arg ""
DEBUG SMTP: Found extension "AUTH", arg "LOGIN XOAUTH2"
DEBUG SMTP: Found extension "8BITMIME", arg ""
DEBUG SMTP: Found extension "BINARYMIME", arg ""
DEBUG SMTP: Found extension "CHUNKING", arg ""
DEBUG SMTP: Found extension "SMTPUTF8", arg ""
DEBUG SMTP: protocolConnect login, host=smtp.office365.com, user=SVC_ToGazer@uccint.onmicrosoft.com, password=<non-null>
DEBUG SMTP: Attempt to authenticate using mechanisms: LOGIN PLAIN DIGEST-MD5 NTLM XOAUTH2
DEBUG SMTP: Using mechanism LOGIN
DEBUG SMTP: AUTH LOGIN command trace suppressed
DEBUG SMTP: AUTH LOGIN succeeded
DEBUG SMTP: use8bit false
MAIL FROM:<foo1@foo1.com>
250 2.1.0 Sender OK
RCPT TO:<foo2@foo2.com>
250 2.1.5 Recipient OK
DEBUG SMTP: Verified Addresses
DEBUG SMTP: foo2@foo2.com
DATA
354 Start mail input; end with <CRLF>.<CRLF>
Date: Wed, 21 Nov 2018 11:00:41 +0000 (UTC)
From: foo1@foo1.com
To: foo2@foo2.com
Message-ID: <681000169.0.1542798041668@mbp-de-baptiste.lan>
Subject: FOO
MIME-Version: 1.0
Content-Type: multipart/mixed;
boundary="----=_Part_1_1921144901.1542798041673"
------=_Part_1_1921144901.1542798041673
Content-Type: text/calendar; charset="utf-8"; method=REQUEST
Content-Transfer-Encoding: base64
QkVHSU46VkNBTEVOREFSClZFUlNJT046Mi4wClBST0RJRDotLy9HUlRnYXogQ29ycG9yYXRpb24v
L05PTlNHTUwgVG9nYXonZXIvL0ZSCk1FVEhPRDpSRVFVRVNUCkJFR0lOOlZFVkVOVApVSUQ6YTQ5
ODVkZjUtNzI1YS00NTA0LTgzNWYtZDhkNTU2ZjliMDIzQHRvZ2F6ZXIuY29tCkRUU1RBTVA6MjAx
ODExMjlUMTgwMDAwWgpPUkdBTklaRVI7Q049dG9nYXplckBpbnQuZ3J0Z2F6LmV1Om1haWx0bzp0
b2dhemVyQGludC5ncnRnYXouZXUKQVRURU5ERUU7Q1VUWVBFPUlORElWSURVQUw7Uk9MRT1SRVEt
UEFSVElDSVBBTlQ7ClBBUlRTVEFUPU5FRURTLUFDVElPTjtSU1ZQPVRSVUU7Q049QmFwdGlzdGUg
QXJuYXVkOwpYLU5VTS1HVUVTVFM9MDptYWlsdG86YmFwdF9pczJAaG90bWFpbC5jb20KRFRTVEFS
VDoyMDE4MTEyOVQxODAwMDAKRFRFTkQ6MjAxODExMjlUMjIwMDAwClNVTU1BUlk6QWZ0ZXJ3b3Jr
IGdheidwYWNobwpMT0NBVElPTjpQYXJpcyA4ZSBhcnIKREVTQ1JJUFRJT046QWZ0ZXJ3b3JrIG/D
uSBsJ29uIHZhIGTDqWd1c3RlciBkdSBib24gZ2FzcGFjaG8uIEonZXNww6hyZSBxdWUgbGUgamV1
IGRlIG1vdCB2b3VzIHBsYcOudC4uLiBFeGNlbGxlbnQhCkVORDpWRVZFTlQKRU5EOlZDQUxFTkRB
Ugo=
------=_Part_1_1921144901.1542798041673--
.
554 5.2.0 STOREDRV.Submission.Exception:InvalidRecipientsException; Failed to process message due to a permanent exception with message A message can't be sent because it contains no recipients. InvalidRecipientsException: A message can't be sent because it contains no recipients. [Hostname=AM6PR01MB5011.eurprd01.prod.exchangelabs.com]
DEBUG SMTP: got response code 554, with response: 554 5.2.0 STOREDRV.Submission.Exception:InvalidRecipientsException; Failed to process message due to a permanent exception with message A message can't be sent because it contains no recipients. InvalidRecipientsException: A message can't be sent because it contains no recipients. [Hostname=AM6PR01MB5011.eurprd01.prod.exchangelabs.com]
RSET
250 2.0.0 Resetting
DEBUG SMTP: MessagingException while sending, THROW:
com.sun.mail.smtp.SMTPSendFailedException: 554 5.2.0 STOREDRV.Submission.Exception:InvalidRecipientsException; Failed to process message due to a permanent exception with message A message can't be sent because it contains no recipients. InvalidRecipientsException: A message can't be sent because it contains no recipients. [Hostname=AM6PR01MB5011.eurprd01.prod.exchangelabs.com]
Any ideas why there is this behavior ?
email kotlin outlook javamail icalendar
email kotlin outlook javamail icalendar
edited Nov 21 '18 at 15:49
ezain
78511029
78511029
asked Nov 21 '18 at 8:52
Baptiste ArnaudBaptiste Arnaud
7691726
7691726
That's pretty weird. You message clearly has recipients so that's not what it's complaining about. The fact that the message is delivered when you remove method=REQUEST suggests that it's complaining about something in the calendar appointment. Should the calendar appointment also mention foo2@foo2.com somehow? Maybe the invitation needs to mention the person you're sending the message to?
– Bill Shannon
Nov 21 '18 at 21:17
The person email is mentioned in the invitation as an attendee so that's not the problem... I'll try to focus my debug in the calendar. Thanks for the suggestion!
– Baptiste Arnaud
Nov 21 '18 at 21:20
add a comment |
That's pretty weird. You message clearly has recipients so that's not what it's complaining about. The fact that the message is delivered when you remove method=REQUEST suggests that it's complaining about something in the calendar appointment. Should the calendar appointment also mention foo2@foo2.com somehow? Maybe the invitation needs to mention the person you're sending the message to?
– Bill Shannon
Nov 21 '18 at 21:17
The person email is mentioned in the invitation as an attendee so that's not the problem... I'll try to focus my debug in the calendar. Thanks for the suggestion!
– Baptiste Arnaud
Nov 21 '18 at 21:20
That's pretty weird. You message clearly has recipients so that's not what it's complaining about. The fact that the message is delivered when you remove method=REQUEST suggests that it's complaining about something in the calendar appointment. Should the calendar appointment also mention foo2@foo2.com somehow? Maybe the invitation needs to mention the person you're sending the message to?
– Bill Shannon
Nov 21 '18 at 21:17
That's pretty weird. You message clearly has recipients so that's not what it's complaining about. The fact that the message is delivered when you remove method=REQUEST suggests that it's complaining about something in the calendar appointment. Should the calendar appointment also mention foo2@foo2.com somehow? Maybe the invitation needs to mention the person you're sending the message to?
– Bill Shannon
Nov 21 '18 at 21:17
The person email is mentioned in the invitation as an attendee so that's not the problem... I'll try to focus my debug in the calendar. Thanks for the suggestion!
– Baptiste Arnaud
Nov 21 '18 at 21:20
The person email is mentioned in the invitation as an attendee so that's not the problem... I'll try to focus my debug in the calendar. Thanks for the suggestion!
– Baptiste Arnaud
Nov 21 '18 at 21:20
add a comment |
1 Answer
1
active
oldest
votes
As mentioned @Bill Shannon in the comment section, the problem came from the calendar formatting.
You need to make sure your ics pass this kind of validator.
For example, in my implementation :
"""BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//GRTgaz Corporation//NONSGML Togaz'er//FR
METHOD:REQUEST
BEGIN:VEVENT
UID:$id
ORGANIZER;RSVP=FALSE;PARTSTAT=ACCEPTED;
ROLE=CHAIR:mailto:SVC_ToGazer@uccint.onmicrosoft.com
ATTENDEE;RSVP=FALSE;PARTSTAT=ACCEPTED;
ROLE=REQ-PARTICIPANT:mailto:${to.email}
DTSTAMP:${startDate[0]}T${startDate[1]}Z
DTSTART:${startDate[0]}T${startDate[1]}
DTEND:${endDate[0]}T${endDate[1]}
SUMMARY:${meetup.name}
LOCATION:${meetup.address}
DESCRIPTION:${meetup.description}
END:VEVENT
END:VCALENDAR
"""
The ORGANIZER
and ATTENDEE
props weren't valid. the property ROLE
must be in the same line. So I modified it to:
"""BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//GRTgaz Corporation//NONSGML Togaz'er//FR
METHOD:REQUEST
BEGIN:VEVENT
UID:$id
ORGANIZER;RSVP=FALSE;PARTSTAT=ACCEPTED;ROLE=CHAIR
:mailto:SVC_ToGazer@uccint.onmicrosoft.com
ATTENDEE;RSVP=FALSE;PARTSTAT=ACCEPTED;ROLE=REQ-PARTICIPANT
:mailto:${to.email}
DTSTAMP:${startDate[0]}T${startDate[1]}Z
DTSTART:${startDate[0]}T${startDate[1]}
DTEND:${endDate[0]}T${endDate[1]}
SUMMARY:${meetup.name}
LOCATION:${meetup.address}
DESCRIPTION:${meetup.description}
END:VEVENT
END:VCALENDAR
"""
Now, it works properly.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53408299%2fsend-ics-file-rsvp-format-not-working-properly-using-outlook-smtp-server%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
As mentioned @Bill Shannon in the comment section, the problem came from the calendar formatting.
You need to make sure your ics pass this kind of validator.
For example, in my implementation :
"""BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//GRTgaz Corporation//NONSGML Togaz'er//FR
METHOD:REQUEST
BEGIN:VEVENT
UID:$id
ORGANIZER;RSVP=FALSE;PARTSTAT=ACCEPTED;
ROLE=CHAIR:mailto:SVC_ToGazer@uccint.onmicrosoft.com
ATTENDEE;RSVP=FALSE;PARTSTAT=ACCEPTED;
ROLE=REQ-PARTICIPANT:mailto:${to.email}
DTSTAMP:${startDate[0]}T${startDate[1]}Z
DTSTART:${startDate[0]}T${startDate[1]}
DTEND:${endDate[0]}T${endDate[1]}
SUMMARY:${meetup.name}
LOCATION:${meetup.address}
DESCRIPTION:${meetup.description}
END:VEVENT
END:VCALENDAR
"""
The ORGANIZER
and ATTENDEE
props weren't valid. the property ROLE
must be in the same line. So I modified it to:
"""BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//GRTgaz Corporation//NONSGML Togaz'er//FR
METHOD:REQUEST
BEGIN:VEVENT
UID:$id
ORGANIZER;RSVP=FALSE;PARTSTAT=ACCEPTED;ROLE=CHAIR
:mailto:SVC_ToGazer@uccint.onmicrosoft.com
ATTENDEE;RSVP=FALSE;PARTSTAT=ACCEPTED;ROLE=REQ-PARTICIPANT
:mailto:${to.email}
DTSTAMP:${startDate[0]}T${startDate[1]}Z
DTSTART:${startDate[0]}T${startDate[1]}
DTEND:${endDate[0]}T${endDate[1]}
SUMMARY:${meetup.name}
LOCATION:${meetup.address}
DESCRIPTION:${meetup.description}
END:VEVENT
END:VCALENDAR
"""
Now, it works properly.
add a comment |
As mentioned @Bill Shannon in the comment section, the problem came from the calendar formatting.
You need to make sure your ics pass this kind of validator.
For example, in my implementation :
"""BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//GRTgaz Corporation//NONSGML Togaz'er//FR
METHOD:REQUEST
BEGIN:VEVENT
UID:$id
ORGANIZER;RSVP=FALSE;PARTSTAT=ACCEPTED;
ROLE=CHAIR:mailto:SVC_ToGazer@uccint.onmicrosoft.com
ATTENDEE;RSVP=FALSE;PARTSTAT=ACCEPTED;
ROLE=REQ-PARTICIPANT:mailto:${to.email}
DTSTAMP:${startDate[0]}T${startDate[1]}Z
DTSTART:${startDate[0]}T${startDate[1]}
DTEND:${endDate[0]}T${endDate[1]}
SUMMARY:${meetup.name}
LOCATION:${meetup.address}
DESCRIPTION:${meetup.description}
END:VEVENT
END:VCALENDAR
"""
The ORGANIZER
and ATTENDEE
props weren't valid. the property ROLE
must be in the same line. So I modified it to:
"""BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//GRTgaz Corporation//NONSGML Togaz'er//FR
METHOD:REQUEST
BEGIN:VEVENT
UID:$id
ORGANIZER;RSVP=FALSE;PARTSTAT=ACCEPTED;ROLE=CHAIR
:mailto:SVC_ToGazer@uccint.onmicrosoft.com
ATTENDEE;RSVP=FALSE;PARTSTAT=ACCEPTED;ROLE=REQ-PARTICIPANT
:mailto:${to.email}
DTSTAMP:${startDate[0]}T${startDate[1]}Z
DTSTART:${startDate[0]}T${startDate[1]}
DTEND:${endDate[0]}T${endDate[1]}
SUMMARY:${meetup.name}
LOCATION:${meetup.address}
DESCRIPTION:${meetup.description}
END:VEVENT
END:VCALENDAR
"""
Now, it works properly.
add a comment |
As mentioned @Bill Shannon in the comment section, the problem came from the calendar formatting.
You need to make sure your ics pass this kind of validator.
For example, in my implementation :
"""BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//GRTgaz Corporation//NONSGML Togaz'er//FR
METHOD:REQUEST
BEGIN:VEVENT
UID:$id
ORGANIZER;RSVP=FALSE;PARTSTAT=ACCEPTED;
ROLE=CHAIR:mailto:SVC_ToGazer@uccint.onmicrosoft.com
ATTENDEE;RSVP=FALSE;PARTSTAT=ACCEPTED;
ROLE=REQ-PARTICIPANT:mailto:${to.email}
DTSTAMP:${startDate[0]}T${startDate[1]}Z
DTSTART:${startDate[0]}T${startDate[1]}
DTEND:${endDate[0]}T${endDate[1]}
SUMMARY:${meetup.name}
LOCATION:${meetup.address}
DESCRIPTION:${meetup.description}
END:VEVENT
END:VCALENDAR
"""
The ORGANIZER
and ATTENDEE
props weren't valid. the property ROLE
must be in the same line. So I modified it to:
"""BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//GRTgaz Corporation//NONSGML Togaz'er//FR
METHOD:REQUEST
BEGIN:VEVENT
UID:$id
ORGANIZER;RSVP=FALSE;PARTSTAT=ACCEPTED;ROLE=CHAIR
:mailto:SVC_ToGazer@uccint.onmicrosoft.com
ATTENDEE;RSVP=FALSE;PARTSTAT=ACCEPTED;ROLE=REQ-PARTICIPANT
:mailto:${to.email}
DTSTAMP:${startDate[0]}T${startDate[1]}Z
DTSTART:${startDate[0]}T${startDate[1]}
DTEND:${endDate[0]}T${endDate[1]}
SUMMARY:${meetup.name}
LOCATION:${meetup.address}
DESCRIPTION:${meetup.description}
END:VEVENT
END:VCALENDAR
"""
Now, it works properly.
As mentioned @Bill Shannon in the comment section, the problem came from the calendar formatting.
You need to make sure your ics pass this kind of validator.
For example, in my implementation :
"""BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//GRTgaz Corporation//NONSGML Togaz'er//FR
METHOD:REQUEST
BEGIN:VEVENT
UID:$id
ORGANIZER;RSVP=FALSE;PARTSTAT=ACCEPTED;
ROLE=CHAIR:mailto:SVC_ToGazer@uccint.onmicrosoft.com
ATTENDEE;RSVP=FALSE;PARTSTAT=ACCEPTED;
ROLE=REQ-PARTICIPANT:mailto:${to.email}
DTSTAMP:${startDate[0]}T${startDate[1]}Z
DTSTART:${startDate[0]}T${startDate[1]}
DTEND:${endDate[0]}T${endDate[1]}
SUMMARY:${meetup.name}
LOCATION:${meetup.address}
DESCRIPTION:${meetup.description}
END:VEVENT
END:VCALENDAR
"""
The ORGANIZER
and ATTENDEE
props weren't valid. the property ROLE
must be in the same line. So I modified it to:
"""BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//GRTgaz Corporation//NONSGML Togaz'er//FR
METHOD:REQUEST
BEGIN:VEVENT
UID:$id
ORGANIZER;RSVP=FALSE;PARTSTAT=ACCEPTED;ROLE=CHAIR
:mailto:SVC_ToGazer@uccint.onmicrosoft.com
ATTENDEE;RSVP=FALSE;PARTSTAT=ACCEPTED;ROLE=REQ-PARTICIPANT
:mailto:${to.email}
DTSTAMP:${startDate[0]}T${startDate[1]}Z
DTSTART:${startDate[0]}T${startDate[1]}
DTEND:${endDate[0]}T${endDate[1]}
SUMMARY:${meetup.name}
LOCATION:${meetup.address}
DESCRIPTION:${meetup.description}
END:VEVENT
END:VCALENDAR
"""
Now, it works properly.
answered Nov 22 '18 at 13:10
Baptiste ArnaudBaptiste Arnaud
7691726
7691726
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53408299%2fsend-ics-file-rsvp-format-not-working-properly-using-outlook-smtp-server%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
That's pretty weird. You message clearly has recipients so that's not what it's complaining about. The fact that the message is delivered when you remove method=REQUEST suggests that it's complaining about something in the calendar appointment. Should the calendar appointment also mention foo2@foo2.com somehow? Maybe the invitation needs to mention the person you're sending the message to?
– Bill Shannon
Nov 21 '18 at 21:17
The person email is mentioned in the invitation as an attendee so that's not the problem... I'll try to focus my debug in the calendar. Thanks for the suggestion!
– Baptiste Arnaud
Nov 21 '18 at 21:20