Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with line break in "body:" #41

Closed
thalesfsp opened this issue Aug 24, 2011 · 3 comments
Closed

Problem with line break in "body:" #41

thalesfsp opened this issue Aug 24, 2011 · 3 comments

Comments

@thalesfsp
Copy link

If you try to send a message with line breaks

"Hello!

How are you!?

Cheers!"

Occour an error!

The same message:

"Hello! \n\nHow are you!?\n\nCheers!"

Its ok!

Can you fix it!? Thanks!

@andris9
Copy link
Member

andris9 commented Aug 24, 2011

Hi,

are you trying to set the linebreaks in your code like this?

{
    from: "sender@mail.ee",
    to: "receiver@mail.ee",
    subject: "test mail",

    text: "Hello!

How are you!?

Cheers!"
}

This doesn't work since JavaScript doesn't support multi-line strings, you need to go with \n symbols.

{
    from: "sender@mail.ee",
    to: "receiver@mail.ee",
    subject: "test mail",

    text: "Hello!\n\nHow are you!?\n\nCheers!"
}

@thalesfsp
Copy link
Author

Oh! :( Well, its a form to pass an html file like this:

<!DOCTYPE html>
<html>
    <head>
        <style type="text/css">
            body, p {
                margin:0px;
                padding: 0px;
            }
        </style>
    </head>
    <body>
        <p>Olá! Isso é um teste!</p>
    </body>
</html>

and here to it:

{
    from: "sender@mail.ee",
    to: "receiver@mail.ee",
    subject: "test mail",

    htmlFile: "myEmailMkt.html"
}

Thanks!

@andris9
Copy link
Member

andris9 commented Aug 24, 2011

I don't think this is a Nodemailer issue. You should check the input from the file you are reading since Nodemailer doesn't touch line endings at all - it simply passes everything entered to to the server

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants