Av någon anledningen så hittade jag ändå inte något ställe att byta ut denna kod(jag la till det jag glömde föra gången)
sub SendMail(sTo, sSubject, sBody)
'TO DO: Change the mail configuration
sMailServer = "mail.costodia.com"
sMailSender = "dev@costodia.com"
sMailSenderName = "Costodia"
Set CDONTS = Server.CreateObject("CDONTS.SMTPMail")
CDONTS.ServerAddress = sMailServer
CDONTS.Sender = sMailSender
CDONTS.Sendername = sMailSenderName
CDONTS.Subject = sSubject
CDONTS.AddRecipient sTo
CDONTS.Body = sBody
CDONTS.Execute
end sub
Den artiklen du icaaq tar tyvärr bara upp att skicka ut massmail.
Och den söken på google du spango la in visar inte heller så mycket.
den tar dels upp http://www.aspalliance.com/Yusuf/Article09.asp , på http://www.allarticles.com/resources/articles/article.asp?id=11 så skriver de t ex så här
'Declare Variables
Dim CDONTSObj, MessageBody
'Create the CDONTS object
Set CDONTSObj = Server.CreateObject("CDONTS.NewMail")
'To Address
CDONTSObj.To = "info@scriptmate.com"
'From Address
CDONTSObj.From = "you@yoursite.com"
'CC Email Addresses seperated by a comma
CDONTSObj.cc = "support@scriptmate.com,amit@millioncolors.com"
'Your Email Message
MessageBody = "Sending a email using ASP was never so easy ! "
'Subject of the Email Message
CDONTSObj.Subject = "Send a Email"
'Assigning the value of your message to the Object
CDONTSObj.Body = MessageBody
'Send the email
CDONTSObj.Send
'Set the CDONTS object to nothing
Set CDONTSObj = nothing
men tar tex inte upp hur man ställer in smtp:n, på http://www.beginnersasp.co.uk/cdonts1.aspåtar tar de upp det så här
<%
'declare our variables
Dim strMessage , objCDO
Set objCDO = Server.CreateObject("cdonts.NewMail")
'stick the e-mail address you are sending from in here
objCDO.From = "myaddress@myaddress.com"
'this is the email address you are sending to
objCDO.To = "anotheremail@myaddress.com"
'this is the title of your e-mail message
objCDO.subject = "this is a test message"
'this is your actual message
objCDO.body = " This is your actual message in here"
objCDO.send
%>
verkar fungera(jag fick inte det att funka till mitt formulär, sen hittade jag denna koden
<%
'declare variables
Dim strTo, strSubject, strBody, strFrom 'Strings for recipient, subject, boby
Dim objCDOMail 'The CDO object
Dim objRec
'grab the variables from the form
strFrom = Request.Form("From")
strSubject = Request.Form("subject")
strBody = Request.Form("body")
Set objRec = Server.CreateObject ("ADODB.Recordset")
'open the database
objRec.Open "EmailList", strConnect, adOpenKeyset, _
adLockReadOnly, adCmdTable
'notify the user that the broadcast has started
Response.Write("<h1>Broadcast Starting</h1>")
'loop through the recordset
While Not objRec.EOF
'create a new cdo object
Set objCDOMail = Server.CreateObject("CDONTS.NewMail")
'set its properties
objCDOMail.From = strFrom
objCDOMail.To = objRec("EMail")
objCDOMail.Subject = strSubject
objCDOMail.Body = strBody
'send the mail
objCDOMail.Send
'set the object = nothing
Set objCDOMail = Nothing
'confirm to the user that the mail has been sent
Response.Write "Message sent to " & objRec("EMail") & "!<br>"
'go to the next record
objRec.MoveNext
WEND
'notify the user that the broadcast has completed
Response.Write("<h1>Broadcast Comlete</h1>")
%>
men då får jag felet
ADODB.Recordset error '800a0bb9'
Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.
/dev/services/sponsorship.asp, line 22
Finns det ingen på Webforum som råkar ha kvar Stefan Holmbergs från ASPCODE.net?, själv verkar han intesvara på några mail alls.
------------------
Mvh Martin Persson
Costodia.com, martinpersson.com, Merinternet.com , Sveriges.com , Sigill.net , dress.nu , mittinternet.com