cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
giselisestari
Level: Powered On

Office365.sendmail - new line

Created an app, and I would like to send more than one line in the body of the email. Can you do that?

Sorry for the english, I'm Brazilian so there may be some errors. Smiley Happy

 

Office365.SendEmail('E-mail do Cliente_DataCard1'.Default; "Descrição do Atendimento" & 'Descrição Atendimento_DataCard2'.Default; "Nome do Cliente: " & 'Nome do Cliente_DataCard2'.Default & "Produto: " & Produto_DataCard2.Default;{Attachments:Table({Name:"Teste.jpg";ContentBytes:MyDoodles.Image;'@data.type':""})})

1 ACCEPTED SOLUTION

Accepted Solutions
PowerApps Staff CarlosFigueira
PowerApps Staff

Re: Office365.sendmail - new line

Boa tarde Smiley Happy

You can use the Char(10) expression, which represents a new line character, to split the message body in multiple lines, like in the example below:

Office365.SendEmail(
    'E-mail do Cliente_DataCard1'.Default;
    "Descrição do Atendimento: " & 'Descrição Atendimento_DataCard2'.Default;
    "Nome do Cliente: " & 'Nome do Cliente_DataCard2'.Default & Char(10) &
        "Produto: " & Produto_DataCard2.Default;
    {
        Attachments: Table(
            { Name: "Teste.jpg"; ContentBytes:MyDoodles.Image; '@odata.type':"" }
        )
    })

Another hint that I noticed - the Default property of the cards stores the initial values from the data source. If the user types something different in the text input controls, for example, the Default property will not be changed. You can use the Update property of the card, which should have the current version of the text input:

Office365.SendEmail(
    'E-mail do Cliente_DataCard1'.Update;
    "Descrição do Atendimento: " & 'Descrição Atendimento_DataCard2'.Update;
    "Nome do Cliente: " & 'Nome do Cliente_DataCard2'.Update & Char(10) &
        "Produto: " & Produto_DataCard2.Update;
    {
        Attachments: Table(
            { Name: "Teste.jpg"; ContentBytes:MyDoodles.Image; '@odata.type':"" }
        )
    })

Hope this helps!

4 REPLIES 4
JLockwood
Level: Powered On

Re: Office365.sendmail - new line

If you set IsHtml to true, then you can use break tags:

 

 

Office365.SendEmail(emailto, "Testing Linebreaks", "This is <br> <br> a test", {IsHtml: true})

 

LineBreak.png

PowerApps Staff CarlosFigueira
PowerApps Staff

Re: Office365.sendmail - new line

Boa tarde Smiley Happy

You can use the Char(10) expression, which represents a new line character, to split the message body in multiple lines, like in the example below:

Office365.SendEmail(
    'E-mail do Cliente_DataCard1'.Default;
    "Descrição do Atendimento: " & 'Descrição Atendimento_DataCard2'.Default;
    "Nome do Cliente: " & 'Nome do Cliente_DataCard2'.Default & Char(10) &
        "Produto: " & Produto_DataCard2.Default;
    {
        Attachments: Table(
            { Name: "Teste.jpg"; ContentBytes:MyDoodles.Image; '@odata.type':"" }
        )
    })

Another hint that I noticed - the Default property of the cards stores the initial values from the data source. If the user types something different in the text input controls, for example, the Default property will not be changed. You can use the Update property of the card, which should have the current version of the text input:

Office365.SendEmail(
    'E-mail do Cliente_DataCard1'.Update;
    "Descrição do Atendimento: " & 'Descrição Atendimento_DataCard2'.Update;
    "Nome do Cliente: " & 'Nome do Cliente_DataCard2'.Update & Char(10) &
        "Produto: " & Produto_DataCard2.Update;
    {
        Attachments: Table(
            { Name: "Teste.jpg"; ContentBytes:MyDoodles.Image; '@odata.type':"" }
        )
    })

Hope this helps!

giselisestari
Level: Powered On

Re: Office365.sendmail - new line

Thank you worked out using char (10) and I followed your tip. PowerApps is a fascinating product. Thanks.

giselisestari
Level: Powered On

Re: Office365.sendmail - new line

Thank you it worked, com o IsHTML.
Thanks.

Helpful resources

Announcements
firstImage

PowerApps Monthly Community Call!

Join us next Wednesday for our Demo Extravaganza, October 16, 2019 8am PDT.

firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Top Kudoed Authors
Users Online
Currently online: 464 members 4,678 guests
Please welcome our newest community members: