Forum Moderators: open

Message Too Old, No Replies

Send Email with attatchment

Send Email with attatchment using CDOSYS

         

Philly

9:41 pm on May 3, 2005 (gmt 0)

10+ Year Member



Does anyone know how to send an attatchment "from an application residing on a client browser"?

Basic script:
TheAttachment = Request.Form("Attatchment")

Set cdoMessage = Server.CreateObject("CDO.Message")
Set cdoConfig = Server.CreateObject("CDO.Configuration")
cdoConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
cdoConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "mail server"
cdoConfig.Fields.Update
Set cdoMessage.Configuration = cdoConfig
cdoMessage.From = "From@web.for"
cdoMessage.ReplyTo = "ReplyTo@frt.got"
cdoMessage.To = "to@fceccj.edcu"
cdoMessage.Subject = "Subject of Email"
cdoMessage.HtmlBody = "Body of Email"
cdoMessage.AddAttachment "Don't know what to put here"
on error resume next
cdoMessage.Send
If Err.Number <> 0 Then
Response.Write "Error sending mail "&Err.Number
Else
Response.Write "Email Sent"
End If
Set cdoMessage = Nothing
Set cdoConfig = Nothing

mrMister

11:36 am on May 5, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Request.Form("Attatchment")

The Request object in ASP does not support multipart/form-data encoded POST requests.

You'll need to use a 3rd party component.