hgaraga
03-11-2003, 01:49 PM
Help!!!!! I need an ASP script that can send e-mail, not through an e-mail client but in a form! HELP!!!! :confused:
heuh.
What exactly is your problem (except from your stuck CapsLock;) )
email not through an e-mail client but through a form ? This makes absolutely no sense to me. Can you clarify some more?
By the way, this is not a script-library, so i assume you ran a searc on google or so to find existing scripts.
hgaraga
03-11-2003, 02:02 PM
I mean through a form like this:
<form method="post" action="emailASP.asp">
<input type="textbox name="firstname">....
</form>
The .... I put means that type of code. I put the .... because I couldn't type out all the code. This is the way through a form :o . Send me a reply immediately!
hgaraga
03-11-2003, 02:03 PM
I mean through a form like this:
<form method="post" action="emailASP.asp">
<input type="textbox name="firstname">....
</form>
I put the .... because I couldn't type out all the code. This is the way through a form :o . Send me a reply immediately!
the form isn't sending the mail. it's just posting the adress and message and stuff to an asp page.
That page will probably use CDONTS to create and sent the message. (which is very easy)
The adress and message will be included there with a request.form (reading the formfields and using there content)
More info on creating new mail with CDONTS below (all the way at the bottom is some asp-code to do that.).
If you need more info, run a search on this forum or on google and search for CDONTS
More help from mse.exe helpfile (search for mse.exe on your harddisk at look at the helpfunction)
-------------------------
NewMail Object (CDONTS Library)
The NewMail object provides for sending a message with very few lines of code.
At a Glance
Specified in type library: CDONTS.DLL
First available in: CDO for NTS Library version 1.2
Parent objects: (none)
Child objects: (none)
Default property: Value
Properties
Name Available since version
Type
Access
Bcc 1.2 String Write-only
Body 1.2 IStream object or String Write-only
BodyFormat 1.2 Long Write-only
Cc 1.2 String Write-only
ContentBase 1.2 String Write-only
ContentLocation 1.2 String Write-only
From 1.2 String Write-only
Importance 1.2 Long Write-only
MailFormat 1.2 Long Write-only
Subject 1.2 String Write-only
To 1.2 String Write-only
Value 1.2 String Write-only
Version 1.2 String Read-only
Methods
Name Available since version
Parameters
AttachFile 1.2 Source as Object or String,
(optional) FileName as String,
(optional) EncodingMethod as Long
AttachURL 1.2 Source as Object or String,
ContentLocation as String,
(optional) ContentBase as String,
(optional) EncodingMethod as Long
Send 1.2 (optional) From as String,
(optional) To as String,
(optional) Subject as String,
(optional) Body as Object or String,
(optional) Importance as Long
SetLocaleIDs 1.2 CodePageID as Long
Remarks
The NewMail object is not built on the normal API architecture. It is meant for rapid generation of notification mail by an automated process running in the Microsoft® Windows NT® Server. No user interface is supplied, and no interaction with human users is expected during the generation and sending of the message. Therefore the NewMail object's properties are not designed to be read back and inspected. With the sole exception of Version, they can only be written.
The NewMail object is self-contained and does not expose any of the Properties Common to All CDO for NTS Library Objects.
Attachments and recipients, once added to the NewMail object, cannot be removed, and the NewMail object itself cannot be deleted. When the Send method completes successfully, the NewMail object is invalidated but not removed from memory. The programmer should Set the invalid object to Nothing to remove it from memory, or reassign it to another NewMail object. Attempted access to a sent NewMail object results in a return of CdoE_INVALID_OBJECT.
The NewMail object does not belong to the hierarchy encompassing the other CDO for NTS Library objects. It cannot access, nor can it be accessed from, any of the other objects. Like the Session object, it is considered a top-level object and is created directly from a Microsoft® Visual Basic® program. Its ProgID is CDONTS.NewMail. This code fragment creates a NewMail object through early binding:
Dim objNewMail As CDONTS.NewMail
Set objNewMail = CreateObject("CDONTS.NewMail")
The main advantage of the NewMail object is the ease and simplicity with which you can generate and send a message. You do not have to log on to a session nor deal with a folder or a messages collection. You have only to create the NewMail object, send it, and Set it to Nothing. You can supply critical information in the parameters of the Send method. In many cases you only need three lines of code:
Set objNewMail = CreateObject("CDONTS.NewMail")
objNewMail.Send("me@company.com", "you@company.com", "Hello", _
"I sent this in 3 statements!", 0) ' low importance
Set objNewMail = Nothing ' canNOT reuse it for another message
Including an attachment can add as little as one statement to your code, because you can pass information in the parameters of the AttachFile method:
Set objNewMail = CreateObject("CDONTS.NewMail")
objNewMail.AttachFile("\\server\schedule\sched.xls", "SCHED.XLS")
objNewMail.Send("Automated Schedule Generator", "you@company.com", _
"Schedule", "Here's the latest master schedule", 0)
Set objNewMail = Nothing
vBulletin® v3.8.2, Copyright ©2000-2010, Jelsoft Enterprises Ltd.