cancel
Showing results for 
Search instead for 
Did you mean: 

Raise Alert with HTML and add attachments

0 Kudos
675

Hi SAP Community,

I'm using raise alert function to notify user, the body of the email will be in HTML format, specifically a html table. Is it possible to use the raise alert function to send email with html body as the content.

Been trying but the email won't parse the html tags. Is there any way to overcome this issue. Using outlook app is not possible since our client didn't allocate any outlook license for the email and only provide the email with smtp.

Also if could is it possible to add an attachment for the email using the raise alert function.

Thanks and Regards,

Nael

View Entire Topic
chwostian
Participant

Hi Nael,

To the best of my knowledge the answer is NO. If you want to use your alerter as a notifier then you are stuck with the standard functionality.

But I see another approach here:

- you use your alerter to notify of CF or agent events (in this case you use only simple text messages),

- for all other situations you can use some scripting solution like vbscript or node.js combined with execute command activity (you can use it to send standard html messages or report errors that you catch and process in your automation).

For vbscript I suggest you visit this page https://www.rondebruin.nl/win/s1/cdo.htm for more details. Test it first from within excel. I have just done it and it works. I also tested authentication by providing user and password. It does send html messages and this is fast. A lot faster than outlook. I haven't tested sending attachments but I am positive it will work.

Here's a list of steps you need to follow:

- create a vbs script file that takes arguments,

- add it to your project

- read its absolute path at run time

I suggest moving it to a different location to make sure its path does not exceed the path length the wscript allows (I am not sure about this one but I remember I had I had some issues). I chose my path to be C:\\Temp

- and now you can use execute command activity

you need to now concatenate your params. In your case your params could be like SMTPServer, PORT, SenderAddress, Recipient, PathsToYourAttachments, User and Password and so for and so forth.

Let me know if this solves your query or you get stuck with the solution I described above. If you get stuck I'll create a blog with a full solution.

Nevertheless let's ask an expert here if there are any other less sophisticated solutions (however I think this is quite easy and straightforward) but against low-code approach. jleonard hi Julien could you chip in on that? Any suggestions? Or perhaps we're missing something here that is right there in front of us. Thanks:)

0 Kudos

Hey Jakub,

Sorry for the late response on this matter,

I find that your way is the simplest approach to solve the matter. Truly needing to use the vbscript to send out email is quite unpractical since we are unable to utilize the SAP tools that are available. But the script works a charm! just that if any errors thrown I haven't come out a way to capture it back.

Regards,

Nael