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. 🙂

 

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
Power Apps Staff CarlosFigueira
Power Apps Staff

Re: Office365.sendmail - new line

Boa tarde 🙂

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!

View solution in original post

5 REPLIES 5
Highlighted
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

Power Apps Staff CarlosFigueira
Power Apps Staff

Re: Office365.sendmail - new line

Boa tarde 🙂

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!

View solution in original post

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.

Hash
Level: Powered On

Re: Office365.sendmail - new line

Char(10) , Char(13) or both together , nothing working. OR it stopped working now.

Helpful resources

Announcements
thirdimage

Power Apps Community User Group Member Badge

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

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (6,295)