Sending Email with attachment and also with HTML format

General question about the package, problems, solutions
apugazhenthy
Posts: 15
Joined: Mon Jun 27, 2016 8:16 am

Sending Email with attachment and also with HTML format

Postby apugazhenthy » Mon Jun 27, 2016 8:25 am

Hi,

I want to send a email notification with HTML format and also with attachments but I could not achieve this feature in one email notification rule. the content type of the both varies as text/html and multipart/mixed.so if I want use both this feature, what should I do?. looking for your response. Thanks in advance.





Regards
Pugazhenthy A

Pavel
Posts: 281
Joined: Fri Dec 12, 2008 12:19 am

Re: Sending Email with attachment and also with HTML format

Postby Pavel » Mon Jun 27, 2016 8:53 am

Hello,

Technically, you need to construct MIME/multipart email.
You can find an example here: http://cqadmin.org/wiki/Notification_Ex ... ttachments

The only difference in that example that the first part is plain/text, but it can be anything you need, including HTML.

Pavel

apugazhenthy
Posts: 15
Joined: Mon Jun 27, 2016 8:16 am

Re: Sending Email with attachment and also with HTML format

Postby apugazhenthy » Tue Jun 28, 2016 1:05 am

Pavel wrote:Hello,

Technically, you need to construct MIME/multipart email.
You can find an example here: http://cqadmin.org/wiki/Notification_Ex ... ttachments

The only difference in that example that the first part is plain/text, but it can be anything you need, including HTML.

Pavel


Hi Pavel,

I am not clear on :oops: ,
Technically, you need to construct MIME/multipart email
but here what I have done.

I have created two Udb property RT_HasAttachment and RT_InsertAttachement using that same example.

here attached screenshots of notification rule header and message body and received mail.

The only difference in that example that the first part is plain/text, but it can be anything you need, including HTML.

I have done the change you suggested by replaced text/plain into text/html in message body. but still I am getting the mail without html contents :( .

so please help me to get html contents as well as attachment in a email message.

Many Thanks,
Pugazhenthy A
Attachments
mail.JPG
mail.JPG (32.19 KiB) Viewed 2153 times
rule-msgbody.JPG
rule-msgbody.JPG (46.77 KiB) Viewed 2153 times
rule-header.JPG
rule-header.JPG (41.69 KiB) Viewed 2153 times

Pavel
Posts: 281
Joined: Fri Dec 12, 2008 12:19 am

Re: Sending Email with attachment and also with HTML format

Postby Pavel » Tue Jun 28, 2016 7:49 am

Hi,

You added "RTC_InsertAttachments() before the HTML message, while it suppose to go after. It is what caused problem in your case.

Anyway, a good what to troubleshoot issues is to check generated email in the message queue (en_email_message records). it is available when Deferred (default) or Queue delivery mode is used.

Pavel

apugazhenthy
Posts: 15
Joined: Mon Jun 27, 2016 8:16 am

Re: Sending Email with attachment and also with HTML format

Postby apugazhenthy » Tue Jun 28, 2016 11:04 am

Hi Pavel,

Anyway, a good what to troubleshoot issues is to check generated email in the message queue (en_email_message records). it is available when Deferred (default) or Queue delivery mode is used.



in my case there is no any error message in delivery Queue.



Pavel wrote:Hi,

You added "RTC_InsertAttachments() before the HTML message, while it suppose to go after. It is what caused problem in your case.



I have added that RT_InsertAttachments() function after the html code(shown in below attachment file) but still I am getting only attachment in mail but no html content.

now my header content type is multipart/mixed if changed it to text/html, getting mail in html but nothing attached. As of my understanding it sending contents with respect to header content type. so please let me know the exact header content type for sending both html and attachment.
Attachments
msgbody2.JPG
msgbody2.JPG (46.01 KiB) Viewed 2144 times

Pavel
Posts: 281
Joined: Fri Dec 12, 2008 12:19 am

Re: Sending Email with attachment and also with HTML format

Postby Pavel » Tue Jun 28, 2016 12:02 pm

Inspect generated message in en_email_message, and you will see what caused the issue this time.
IN your particular case, check for attachements should be in the beginning of the message, and InsertAttachements at the end, after HTML content.
Pavel

apugazhenthy
Posts: 15
Joined: Mon Jun 27, 2016 8:16 am

Re: Sending Email with attachment and also with HTML format

Postby apugazhenthy » Wed Jun 29, 2016 1:19 am

Pavel wrote:IN your particular case, check for attachements should be in the beginning of the message, and InsertAttachements at the end, after HTML content.
Pavel


Thanks a lot Pavel :D ... now it is working as expected.


Return to “Email Notification Package Q&A”

Who is online

Users browsing this forum: No registered users and 1 guest

cron