cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Durell_T
Frequent Visitor

Data table as body of email

@WarrenBelz I am creating an app that will gather information about a new hire and what equipment they will need. I am now at the point where I need to take the data and send it as an email. I have already created an HTMLtext document that will house all my gathered data. However, I am having issues collecting the HTMLtext document and sending it to my email. Below will be a copy of my HTMLtext document.

 

Thank You

 

 

 

 

"<table width='100%' border='1' cellpadding='5' style='border:1px solid black; border-collapse:collapse'>" &
    "<tr style='background-color:#efefef'>
        <th>StartDate</th>
	<th>FirstName</th>
        <th>LastName</th>
        <th>Community</th>
	<th>Position</th>
	<th>Supervisor</th>
	<th>Microsoft</th>
	<th>DropBox</th>
	<th>Concur</th>
	<th>Upkeep</th>
	<th>Eldermark</th>
	<th>EMAR</th>
	<th>SM</th>
	<th>MM</th>
	<th>Phone</th>
	<th>Laptop</th>
	
    </tr>" &
    Concat(Data,
    "<tr>
        <td>" & Date & " </td>
        <td>" & FirstName & " </td>
        <td>" & LastName & " </td>
	<td>" & Community & " </td>
	<td>" & Position & " </td>
	<td>" & Supervisor & " </td>
	<td>" & Microsoft & " </td>
	<td>" & DropBox & " </td>
	<td>" & Concur & " </td>	
	<td>" & Upkeep & " </td>
	<td>" & Eldermark & " </td>
	<td>" & EMAR & " </td>
	<td>" & SM & " </td>
	<td>" & MM & " </td>
	<td>" & Phone & " </td>
	<td>" & Laptop & " </td>
    </tr>") &
    "</table>"

 

 

 

 

 

13 REPLIES 13

@Durell_T I think you need to specify that the body is HTML:

'Outlook.com'.SendEmail ( "GrandITSUPP@outlook.com", "New Hire Form" ,  "<span>" & HtmlText1.HtmlText & "<span>", {IsHTML: true})

 

Durell_T
Frequent Visitor

@TJO It didn't like that code unfortunately so I modified it. Below is the new version but it doesn't like one bracket in front of "IsHTML:  true". I feel like we're getting close to fixing my issue though.

 

'Outlook.com'.SendEmail ( "GrandITSUPP@outlook.com", "New Hire Form" ,  "<span>" & HtmlText1.HtmlText & "<span>") {IsHTML: true})

 

 

@Durell_T Maybe you can omit the curly brackets. Anyways the closing bracket after ...span>") needs to be replaced by a comma

Durell_T
Frequent Visitor

Awesome, now it sends the table I need. I will put a copy of the code up for anyone trying to send a table in the future. This will work as long as you set up the connector under Outlook.com and verify it with an email address. Thank you vert much @TJO and @v-yutliu-msft  for all your help I will now mark this issue as fixed.

 

'Outlook.com'.SendEmail ( "Name@ANYEMAIL.COM", "ANY TITLE" ,  "<span>" & HTLMDOCUMENT.HtmlText & "<span>", {IsHtml: true})

 

 

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (2,842)