Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

problem with CDOSYS...

SakuragiSakuragi Member Posts: 21
i have a XP OS and came up wit this code:
it works fine, my only problem is how to test it locally....
:-


[code]
<%
function SendEmail
on error resume next 'This code will only work on a Win2k server.
Dim iMsg,iConf,Flds
Set iMsg = CreateObject("CDO.Message")
Set iConf = CreateObject("CDO.Configuration")
Set Flds = iConf.Fields


Flds(cdoSendUsingMethod) = cdoSendUsingPort
Flds(cdoSMTPServer) = "127.0.0.1"
Flds(cdoSMTPServerPort) = 25
Flds(cdoSMTPAuthenticate) = cdoAnonymous '0
Flds.Update

With iMsg
Set .Configuration = iConf
.To = Request("Username: " & rst("cust_emailaddr")) & vbCrLf
.From = "eric@gamebox.net"
.Subject = "sample mail"

'For body text use either one of below
buf = "Dear " & rst("cust_fname") & vbCrLf
buf = buf & " " & vbCrLf
buf = buf & "Thank you for registering." & vbCrLf
buf = buf & " " & vbCrLf
buf = buf & "Your login details are as follows:" & vbCrLf
buf = buf & " " & vbCrLf
buf = buf & "Username: " & rst("cust_emailaddr") & vbCrLf
buf = buf & "Password: " & rst("cust_passwd") & vbCrLf
buf = buf & " " & vbCrLf
buf = buf & "To Activate your account, please click on the following link" & vbCrLf
buf = buf & "http://www.yourdomain.net/activate.asp?cid=" & rst("cust_id") & vbCrLf '<--------Change the domain and path but leave after/activate.asp.....in tact
buf = buf & " " & vbCrLf
buf = buf & "Regards" & vbCrLf
buf = buf & "The Administrator" & vbCrLf '<--------Change this if required
'HTMLBody="html stuff"
'.CreateMHTMLBody "http://www.yoursite.com/page.asp"
.Textbody = buf
.Send
End With
end function
%>
<% response.redirect ("thanks.asp")%>
[/code]

Comments

  • Shawn CarterShawn Carter Member Posts: 0

    __ ( http://forcoder.org ) free ebooks and video tutorials about { Visual Basic Assembly C Visual Basic .NET C# Java Perl Scratch PL/SQL C++ R Delphi MATLAB Swift JavaScript PHP Python Objective-C Ruby Go Rust FoxPro COBOL Clojure Apex ABAP Prolog Kotlin Bash Dart Fortran Awk D Erlang Logo Scheme Ada LabVIEW F# Transact-SQL Julia Lua Crystal VBScript Scala Hack SAS Alice ML Lisp } ____________

Sign In or Register to comment.