PDA

View Full Version : ASP File Attachment Mailer.....


ameilius
08-18-2009, 06:11 AM
i need some suggestions.... ive done my reading... learning asp as i go - i got a piece of code that works with me editing manually what i want it to send and where i want it to send....

ok ok ok - im rambling...

heres what i need to accomplish....

i made a ton of .htm files in a /folder - i made an html page with 1 text input field for an email to send the files to - what i want to do is select with radio buttons or check boxes which .htm i want to send to the email address entered - and POSSIBLY have the subject line state which file im sending

ie.

i want to select "1.htm" and "2.htm" and send them to "email@email.com"

im always going to be sending from 1 specific constant email so that can be static... heres what i have so far that can send what i want to who i want - but i want to be able to select multiple files to display as html in their OWN email if possible --- PLEASE ASSIST IF POSSIBLE

<%
Set myMail=CreateObject("THIS IS THE SUBJECT LINE")
myMail.Subject="THIS IS THE SUBJECT LINE"
myMail.From="EMAIL@EMAIL.COM"
myMail.To="RANDOM@EMAIL.COM"
myMail.CreateMHTMLBody "file://C:/FOLDER/1.mht"
myMail.AddAttachment "file://C:/FOLDER/1.pdf"
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing")=2
'Name or IP of remote SMTP server
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver")="SMTP.EMAIL.COM"
'Server port
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport")=25
myMail.Configuration.Fields.Update
myMail.Send
set myMail=nothing
%>

like i said - this works manually... but id like to be able to select which files from an .html page with the check boxes or radio buttons to send to whatever email address i designate....

Old Pedant
08-18-2009, 08:34 PM
Gee, this is a familiar looking post.
http://www.aspmessageboard.com/showthread.php?t=232272

As I said there, you need to clarify your specifications a bit more.

By the by:

Set myMail=CreateObject("THIS IS THE SUBJECT LINE")

Hmmm... a really strange object name, there.

pons_saravanan
08-23-2009, 01:31 PM
i need some suggestions.... ive done my reading... learning asp as i go - i got a piece of code that works with me editing manually what i want it to send and where i want it to send....

ok ok ok - im rambling...

heres what i need to accomplish....

i made a ton of .htm files in a /folder - i made an html page with 1 text input field for an email to send the files to - what i want to do is select with radio buttons or check boxes which .htm i want to send to the email address entered - and POSSIBLY have the subject line state which file im sending

ie.

i want to select "1.htm" and "2.htm" and send them to "email@email.com"

im always going to be sending from 1 specific constant email so that can be static... heres what i have so far that can send what i want to who i want - but i want to be able to select multiple files to display as html in their OWN email if possible --- PLEASE ASSIST IF POSSIBLE

<%
Set myMail=CreateObject("THIS IS THE SUBJECT LINE")
myMail.Subject="THIS IS THE SUBJECT LINE"
myMail.From="EMAIL@EMAIL.COM"
myMail.To="RANDOM@EMAIL.COM"
myMail.CreateMHTMLBody "file://C:/FOLDER/1.mht"
myMail.AddAttachment "file://C:/FOLDER/1.pdf"
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing")=2
'Name or IP of remote SMTP server
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver")="SMTP.EMAIL.COM"
'Server port
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport")=25
myMail.Configuration.Fields.Update
myMail.Send
set myMail=nothing
%>

like i said - this works manually... but id like to be able to select which files from an .html page with the check boxes or radio buttons to send to whatever email address i designate....

you can actually send multiple attachements(html,htm, jpg,whatever file itis)
try the code here
Send Email using CDO (http://www.vbknowledgebase.com/WebApp/Guest/Home/Home.aspx?PageCode=21&Desc=Send-Email(E-Mail)-from-VB6-using-CDO)

the code here is in vb6 can be converted to asp easily