prince varghese v
prince varghese v

Reputation: 31

Cannot send html mail content

<cfhttp url = "https://api.elasticemail.com/mailer/send?username=myusername&api_key=myapi-key&from=#attributes.from#&from_name=#attributes.from#&to=#attributes.to#&subject=#attributes.subject#&body_html=#attributes.content#&reply_to=#attributes.replyto#"
    method = "POST"
    result="mailResult">
</cfhttp>

I am using the above web service for sending emails. When trying to send a large email with HTML content, nothing is being received through the mail. When sending a simple email with HTML content (without any style or background color) it will work correctly. Is there a size limit or any other condition that exists when sending mail? Why is the email not being sent?

Upvotes: 0

Views: 163

Answers (1)

Alex Baban
Alex Baban

Reputation: 11702

You have the content (html body) of your email as part of your query string: &body_html=#attributes.content#. There is a limit for maximum length of a URL.

Try to find out from the documentation of your mail provider API if you can send the content of the email in the body of your POST request using

<cfhttpparam name="body_html" type="formfield" value="#attributes.content#">

Upvotes: 5

Related Questions