I need to send an email with attachment, but the attachment is in the
company website. What I'm doing is:
thumbPath = "Folder/Image.jpg"
thumbPath = "www.companywebsite.com/" & thumbPath
Dim attachment As New MailAttachment(thumbPath)
However, the following error message is fired: Invalid mail attachment
'www.companywebsite.com/Folder/Image.jpg'
I typed the thumbPath in the browser and the Image is found in the
website. How to attach this image in my email?
Thanks in advance,
Ana
Give the complete path : http://www.websitename/Folder/image.jpg
instead of the relative path
Regards
Mateen
1. As above, one option is to use a complete path, this may error
if there is a proxy server between your app and the website.
2. Another option is to download the file to your local machine,
then just check the header to see has it changed, & download it again
if it has...
this way you always have a local file to attach to your email
it may fail with a proxy error as above
3. Yet another option (depending on where your app is running in
relation to the website)
would be to use UNC paths:
\\yourwebserver\your\file\path
This will only be applicable if your website & application are running
in the same network.
you're app will also need permissions to access the network.
Hope this helps
Steve
Download the file first and then add him to the mail
http://lukaszkurylo.com/archive/2009/10/05/asp.net-asp.net-mvc-snippets.aspx#1
About downloading the image, I don't believe this is the est option
for me. In my application, the user has the option to send 0..n emails
and each one of these email may contain a different Image. Suppose we
have 100 emails to be sent and 70 different Images. This means I would
have to download 70 images from the Company Website and I would have
to do this in the client machine. I don't think this would be the best
solution.
Any other suggestions?
Ana
On Dec 18, 11:53 pm, "veryjo...@yahoo.com" <mateenkapa...@gmail.com>
wrote:
On Dec 18, 9:21 pm, Arsalan Tamiz <sallus...@gmail.com> wrote:
> File must be physically attached with email, I think this type of attachment
> is NOT possible.
>
> You can send email in HTML format and put img tag in there with src = that
> particular image address. However due to security issues, the end user may
> NOT able to see images unless he/she allows that.
>