ASP (classic) VPScript get client's attachment - asp-classic

This is my first time making a website.
On the website I have made a form for client to fill in their details. It uses the CDO.Message and smtpserver (gmail) and the details can be sent successfully to my email.
Now I want to add a function to allow client to attach file(s) and send the files with the form to my email.
Can I do this without having the attachment(s) being uploaded to the server? I want the details on the form and the attachment(s) being sent directly to email.
Is it possible to use the AddAttachment function, get the file path on client's machine and send the attachment to email? If so how to get the full file path on client's machine?
Thanks a lot.

No. The file will have to be on the server to use that method to add it to the e-mail.If you do this, be very careful because it is a high security risk to allow users to upload files to the file system of a web server.

Related

FTP Username and password in html link

I just go through Google search before posting this question here but I am not happy with my Google results. I hope someone can help me here.
I have an eCommerce site. All the images are stored in a different ftp server. I need to show all the images on my webpage. When page laods it ask for FTP username and password. I can avoid it by giving username and password in FTP URL. But I do not think it is secure. My password will be accessible to every user of my site.
Is there any other way?
You really should create an FTP account that only has access to the folder with the images on your FTP server. Do that as soon as possible.
For a better overall solution, either synchronize the images to your webserver, or write an HTTP handler that will fetch the image server-side and streams the bytes to the client as if the image was on your server. Have a look at System.Net.FtpWebRequest for the second solution.
If you have write access to disk on the web server, you could implement both parts of the solution. So if an image is fetched the first time, write it to disk before sending it to the client. The next time it's requested, simply redirect the request to the image on disk (or dynamically change the URL of the <img> tag for that product). This way, you build a cache of the images on your web server as time passes. Of course, you need to be able to invalidate the cache in case an image is updated.

IIS sending mail

I have succefully setup my ASP app to be drop the email to a maildrop box designated by the ISS. I can see the email in the folder which I have specified. This is what I have specified in my IIS management settings:
E-mail address: administrator#aspdotnet-suresh.com
Store e-mail in pickup directory: C:\temp\maildrop
Will this send an email to my account specified in the app? This is a password reset system and the email document inside the folder has the correct to and from address but I don't know how to install the actual SMTP server and not sure if the IIS Manager will make it happen by dropping it in this folder?
Sorry, I am new to this stuff
If you want the email delivered, you want to use an SMTP relay [of some sort]. Placing it in the maildrop assumes that there is some other protocol which is going to be used to retreive it from that maildrop (ie. POP3).
If you want to talk about how to configure IIS and SMTP, your question will probably get better results on www.serverfault.com.

How do I send email to files in ASP.NET?

I remember reading somewhere that it's possible to configure your web.config to send email to files, instead of setting up a real SMTP server for development. How is this done?
Hidden Features of ASP.NET

Programmatically Upload larger Files in Flex

I created an application as part of an ASP.NET site. I would like to receive error notifications in my inbox whenever something goes wrong with that flash application.
As I do not have control over our mail server (which has a different domain name), I cannot establish a cross domain policy allowing me to send error emails to my inbox.
Instead, thought I'd send a request to an ASP.NET handler that sends an email on behalf of the flash app.
Now the problem: the error report should include a screenshot of the flash application at the time the error occurred. The FileReference class however only allows file uploads with user interaction (browse dialog) and cannot be used programmatically to send the screenshot to my ASP.NET handler. The plain old POST back only allows files up to ~200K.
Am I missing something or is there no alternative to :
using POST w/ a compressed or resized screenshot
or forcing the user to first save a screenshot and then select it for upload?
Thanks a bunch!
The problem lay in the receiving web service, not in Flex.

web.config email query

In my web.config file there are below entries. It seems like it is used to send mails from my website.
How i know maiks has been sent from my website?
<add key="emailFromAddress" value="help-desk#home.com"/>
<add key="emailTo_StoreAuthorise" value="help-desk#home.com"/>
You can't know that mails have been sent from your web application. It is the responsibility of the mail server to process emails, not the web server - this means that your code will use mail code, which uses the mail server (e.g. exchange) to actually send out the mails.
What you could do, is check the mail server to see what's been sent out on this email address. It's not perfect, because you may have a user who sends mails on this account, so it will only tell you that mail was sent - not that this mail was sent by your code.
If you need this functionality, you'll need to write this information out at some point - e.g. when the code requests the send mail.
The mails are not sent through your website, but through your mail server.
Your options are:
Check the mail server to see if it logs your sent mails.
Add code to the method that sends the mail in your website to log this event in some place.
Maybe check some kind of IIS-log.
Use such a code to generate link wich will set the mail's subject:
<asp:HyperLink id="EMailLink" runat="server"
NavigateUrl="mailto:<%# System.Configuration.ConfigurationSettings.AppSettings("emailFromAddress") %>?subject=[YourSite.com]"
>EmailUs</asp:HyperLink>
I'm assuming you didn't write the app and have inherited it from someone else, but now wish to check that the email functionality is working and can't be bothered to look at the code?
If you are just trying to check that they work in a development setting and your app has a mailSettings config element, you could configure it so that the mails are written to disk, as shown here.

Resources