Answered by:
Anonymous | |
Joined May 2018 | |
1 |
Adding an attachment to an email using location.href='mailto:'
Question
-
User-1881012951 posted
I am sending an email to a list of people and would like to add an attachment.
Current:
location.href='mailto:?bcc=test@tester.com;'
thanks in advance
Answers
-
User1724605321 posted
Hi Apierre ,
location.href='mailto:?bcc=test@tester.com;'Mailto is not a "tag", it's a URL scheme ,and the scheme only allows you to supply values for RFC 822 headers .MailTo Scheme doesn't support Attachments officially. The solution is as Mike suggested : using MailMessage.Attachments property , you could refer to link below for demo about how to send Email with attachment in ASP.NET using SMTP Server :
http://www.codeproject.com/Articles/10828/Sending-Email-with-attachment-in-ASP-NET-using-SMT
Best Regards,
Nan Yu
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
All replies
-
User1724605321 posted
Hi Apierre ,
location.href='mailto:?bcc=test@tester.com;'Mailto is not a "tag", it's a URL scheme ,and the scheme only allows you to supply values for RFC 822 headers .MailTo Scheme doesn't support Attachments officially. The solution is as Mike suggested : using MailMessage.Attachments property , you could refer to link below for demo about how to send Email with attachment in ASP.NET using SMTP Server :
http://www.codeproject.com/Articles/10828/Sending-Email-with-attachment-in-ASP-NET-using-SMT
Best Regards,
Nan Yu
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM