troubleshooting Question

Send HTML Email populated with data via a Stored Procedure.

Avatar of Milkus1
Milkus1Flag for Australia asked on
Microsoft AccessMicrosoft SQL Server
3 Comments1 Solution3967 ViewsLast Modified:
Currently I have an Access 2003 front end and a SQL Server 2008 backend.  Traditionally I have used an Outlook object in Access to construct and send emails from the application. Problem is many users are upgrading, and outlook objects are incompatible depending on windows versions. Rather than troubleshoot 200 user machines, I wish to move the email functionality to the server.

The DBA wants me to do all the grunt work in the backend, which includes constructing the body of the message. We use HTML formatting, and the message has a table in it and has various bits of data that need populating within it. Now I dont have an issue with the sending of the email. I get that OK, but it is the constructing of the message and populating the fields I am confused about. I think it would be easier to construct the message in Access and just pass the details and message body to a 'mail sending' stored proc...but the DBA says 'No'.

So If I want to send this email how could I go about building the body of the message in SQL:

Hello <Insert name>,

Your order number is: <insert order number>

<Table>
CPU                 <insert data>
Memory          <insert data>
etc...
Optional lines in table
Monitor          <insert data>
Trackball          <insert data>
</Table>

I also understand I can use html tags in the string, and I just need to set the format type to HTML.
Any help would be useful.
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 3 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros