cancel
Showing results for 
Search instead for 
Did you mean: 

Load sql query data to csv file and send this file in email as an attachment

hina_walia
New Contributor

Load sql query data to csv file and send this file in email as an attachment. I tried using snowflake execute snap to get sql data and then use csv parser and write to file writer.The data is not shown in file writer. Can you help me on solving this issue and then how to send the csv file in attachment. Thanks

6 REPLIES 6

anubhav_nautiya
Contributor

are you getting an error?, you have to write the file in sldb, also I believe the attachment size should be less than 25 MB, after your file writer snap use an email sender snap and set the attachment property to $filename, This should work fine.
file writer output : image
email sender: image

Regards
Anubhav

hina_walia
New Contributor

Please see attached, (i have 2 issues- csv file not generated and file not sent in email).I am not able to send data of sql to csv file.Please see attached
pipeline sqlcsv_formatter file_writer1

Do you get any data when you validate the pipeline? or you dont get the output in validation too

I am getting cannot connect to email server, though same server works in another application tool for sending email. Can this be a access issue?
Reason:

Failed to send email message: Could not connect to SMTP host: xxx, port: 25

Hide Details…

Email Sender[58b7a2f5ba6d563aff5d73d9_6dded5c7-fe3c-4525-a1b1-2640e8cf9562 – d3383eb5-462b-4d09-b45e-beb2f059f42e]
com.snaplogic.snap.api.SnapDataException: Failed to send email message

at com.snaplogic.snaps.email.EmailSender.writeErrorView(EmailSender.java:629