I am passing the email body with but for some reason, SendGrid is sending an email with as a string in the body.
I have tried everything I guess at this point including.
Sendgrid not sending text to new line
Here is the email body I am passing to the template:
Hi........ <br>To view further details, click here:
Related
I'm generating mailto links in support emails to make it easier to reply to customers directly from within Gmail. A typical mailto link might look like this:
mailto:customer#example.com?subject=Re%3A%20Feedback%20%20%20%5B1620394320%5D&body=%0A%0A%3E%20Original%20message%20from%20customer%40example.com%2C%202021-05-07%3A%0A%3E%20Customer%20message%20here
This works, except the original message is interpreted literally, even though the lines start with > (which I had expected to be interpreted as a quote of a previous message).
So the reply email would literally look like this for the customer:
> Original message from customer#example.com, 2021-05-07:
> Customer message here
What I want is for the lines starting with > to be treated as a quote of the original message, just like when replying to an email from any email client.
Is it possible to make Gmail do this with a body included in a mailto link?
I am generating emails with Google Apps Script and the emails are being sent with line breaks in weird places.
Here is my code
function sendEmail(){
var name = "MyName"
var body = name + " has issued a challenge. You already have a match currently scheduled so you have the option to decline. Reply to this email with the word 'ACCEPT' or 'DECLINE' in the subject." +
"\n\nNOTE: If you do not respond to this email you will automatically accept the challenge and be responsible for scheduling the match within two weeks or suffer a forfeit."
GmailApp.sendEmail("MyEmail#gmail.com", "You've been challenged!", body)
}
You'll notice that it is also putting the text of the first section of the body in a purple color. I also don't know why this is happening but my priority is to stop the line breaks from being put where they shouldn't be.
Google 'Stacks' emails. Say for example I send you an email. Then you reply and I reply again. It stacks them all into one line in your inbox.
Any identical paragraphs in the emails are made purple. Only you see the purple.
If you delete all of the emails out of your inbox and test again, you should notice it in black.
Also, you have code to create two new lines. '\n' x2. You're essentially creating a new paragraph, do you just want a new line to begin instead? If so delete 1x '\n'. Sorry if I'm not understanding your issue.
If you were to insert the body as html and use paragraph tags you would likely be able to achieve the results you are pursuing.
I am on mobile and don't know how to get resource links to prove the above sorry.
Edit: I would make the following change:
body = name + " has issued a challenge. You already have a match currently scheduled so you have the option to decline. Reply to this email with the word 'ACCEPT' or 'DECLINE' in the subject." + "\n\n" + "NOTE: If you do not respond to this email you will automatically accept the challenge and be responsible for scheduling the match within two weeks or suffer a forfeit."
Your code is including the body as plain text so it is automatically cropped at certain line length. Below some questions about the same "problem"
Gmail API - plaintext word wrapping
Why isn't Gmail using quoted-printable encoding?
If you want to have more control about how the message content looks on Gmail, besides sending the content as plain text sent it as HTML. For doing this use
sendemail(recipient,subject,body,options)
Related questions about using the above method:
Sending an email in HTML and plain with a Gmail Apps Script
I have a weird problem and its got me stumped. If I send an email like this (below) it sends fine. The content of the email is html and sending using the first method shows the html content as text as expected.
<cfmail to="xxxx.xxxx#xxxx.com" from="xxxx.xxxx#xxxx.com" subject="To Oxint">
I change nothing in the email except change the cfmail line to this (below)
<cfmail to="xxxx.xxxx#oxint.com" from="xxxx.xxxx#xxxx.com" subject="To Oxint" type="html">
The email is not received. Not in my junk or spam folder. Just not received. CF mail logs show my email as successfully sent.
I've got our network team looking for issues as well, but its baffling. Any suggestions would be very much appreciated.
Some e-mail clients deny HTML mails without a plain part. Try this:
<cfmail from="someone#somewhere.com" to="someone#somewhereelse.com" subject="always deliver e-mails in plain as well">
<cfmailpart type="text/plain">Here is some text.</cfmailpart>
<cfmailpart type="text/html">Here is some <b>bold</b> text.</cfmailpart>
</cfmail>
Order matters here. First text/plain, then text/html.
I'm sending the email message from ABAP-report of SAP ECC 6.0 EHP5 to Microsoft Exchange via SMTP. The message reaches user's inbox in Outlook 2013, but it arrives as an attachment instead to be in the body of the message. From the code's point of view, I'm sending the plain text, and I'm expecting to get it inside the message. Since I'm using the default ABAP-approach to sending emails, which sends text inside of an email body, I suppose that the root of the problem is in Exchange/Outlook side.
Is there any Exchange/Outlook setting, which explicitly directs to send the message as an attachment or inside of the message body?
In the examples given, the body is always typed HTM. For the mail body I always use type RAW and this works just fine (with Lotus Notes). So maybe you try the following when creating your mail body:
document = cl_document_bcs=>create_document(
i_type = 'RAW'
i_text = im_text
i_length = txt_len
i_subject = im_subject ).
No, Outlook/Exchange doesn't provide anything for that. I suppose the issue comes from the ABAP/SAP software.
In my cakephp website i have a controller which handles a simple contact form. But i have a problem! If in the contact_controller.php code i use:
$this->Email->send($this->data['Contact']['message']);
i receive the email in my mail box with linebreaks like the user wrote the message. But if i use:
$this->Email->send();
and create an html template to get the variables that i want to receive in mail, i will receive the same with no linebreaks.
How i can fix that?
Which one do you want? In the first case you send a plain text email, so you will have your line breaks in place.
In the second place you send HTML e-mail, where line breaks are in place, but simply ignored.
So either keep sending mails plain text or use nl2br() function on the body for html output.