Επιστροφή στο Forum : ASP Αποστολή Email - [solved]
Για να ολοκληρώσω το 2ο στάδιο της νέας φόρμας δήλωσης υποστήριξης για τη Διαμαρτυρία, χρειάζομαι κάποιο αντικείμενο που να στέλνει αυτόματα email.
Προφανώ ο server μου (hosting provider) δεν υποστηρίζει τα CDONTS mail objects που χρησιμοποιώ!
Ξέρει κανείς άλλα αντικείμενα σε IIS6 (Windows 2003) που να μπορούν να αποστείλουν email αυτόματα να τσεκάρω αν είναι εγκατεστημένα;
Δεν ξέρω αν δουλεύει,
δες εδώ
http://www.example-code.com/asp/sendEmail.asp
και εδώ
http://www.febooti.com/products/command-line-email/online-help/send-email-asp-script.html
Solved με CDOSYS object
dim oMail
dim strHTML
set oMail = server.createobject("CDO.Message")
Const cdoBasic = 1 'Use basic (clear-text) authentication.
Const cdoSendUsingPort = 2
set iConf = CreateObject("CDO.Configuration")
Set Flds = iConf.Fields
' set the CDOSYS configuration fields to use port 25 on the SMTP server
With Flds
' Specify the authentication mechanism to basic (clear-text) authentication.
.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = cdoBasic
' The username for authenticating to an SMTP server
.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "user"
' The password used to authenticate to an SMTP server
.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "***"
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = cdoSendUsingPort
'Specify mail server
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "mailserver"
'Specify the timeout in seconds
.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 10
' The port on which the SMTP service specified by the smtpserver field is listening for connections (typically 25)
'.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
'Use SSL for the connection (False or True)
'.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = False
.Update
End With
'if err.number<>0 then response.write err.number & "!: " & err.description
oMail.Configuration = iConf
oMail.From = "protest@nethome.gr"
oMail.To = request.Form("email")
oMail.Subject = "Test"
strHTML = "<HTML>"
strHTML = strHTML & "<HEAD>"
strHTML = strHTML & "<BODY>"
strHTML = strHTML & "Click here: http://www.blah.com/act.asp?id=" & id
strHTML = strHTML & "</BODY>"
strHTML = strHTML & "</HTML>"
oMail.HTMLBody = strhtml
oMail.Send
Ερώτηση.... αυτό δουλεύει σωστά τώρα. Γιατί εμένα δεν μου στέλνει ελληνικά!?!?!:sorry:
@ ADSLgr.com All rights reserved.