
20/06/2008, 13:42
|
| | Fecha de Ingreso: abril-2005 Ubicación: chihuahua Mexico
Mensajes: 49
Antigüedad: 20 años Puntos: 0 | |
Respuesta: Problema con el objeto Cdo que rollo caon yo mando correos con esta funcion que por hay me la encontre en el internet pruebala haber si t funciona
Function SendCDOEmail(smtpserver,username,password, strSubject, strBody,strFromAddress,strToAddress,strCc, intpriority, strBodyFormat)
'smtpserver = your smtp server name'username = the username required for smtp authorisation
'password= the password required for smtp autorisation
'strSubject= subject text
'strBody = body text / html
'strFromAddress= from whom the email will be sent
'strToAddress= who the email will be sent to
'strCc= to who the email will be Cc'd to
'intpriority= importance of email (0=low, 1=normal, 2=high)
'strBodyFormat= either HTML or text
' response.Write("<b>Debug Code:</b> subject = " & strSubject & " , Body = "& strBody & "From = " & strFromAddress & " ,To= " & strToAddress & " , cc= " & strCc & " , priority = " & intpriority & " , Body Format = " & strBodyFormat & "<br>" & vbcrlf) 'debug code
'set up connection
' send email using cdosys
dim objCDOSysCon, objCDOSysMail
'Create the e-mail server object
Set objCDOSYSMail = Server.CreateObject("CDO.Message")
Set objCDOSYSCon = Server.CreateObject ("CDO.Configuration")
'Set and update fields properties
With objCDOSYSCon
'Outgoing SMTP server
.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = smtpserver
.Fields("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
.Fields("http://schemas.microsoft.com/cdo/configuration/sendusername") = username
.Fields("http://schemas.microsoft.com/cdo/configuration/sendpassword") = password
.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
'CDO Port
.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2'Timeout
.Fields("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
.Fields.Update
End With
'Update the CDOSYS Configuration
Set objCDOSYSMail.Configuration = objCDOSYSCon
'Set and update email properties
With objCDOSYSMail
'0=Low, 1=Normal, 2=High
.Fields("urn:schemas:httpmail:importance").Value = intpriority
'0=low, 1=normal, 2=high
.From = strFromAddress
'who the email is from
.To = strToAddress
'who the email is sent to
.Cc = strCc
'who the email is Cc'd to'The subject of the email
.subject = strSubject
'set the email body format
if ucase(strBodyFormat) ="HTML" then
.HTMLBody = strBody
else.textbody = strbody
end if
.fields.update
On Error Resume Next
.send
SendCDOEmail=Err
end with
'clean up
set objCDOSysMail = nothingset
objCDOSysCon = nothing
End Function
y asi de pelada la llamas
call SendCDOEmail("servidor","usuario","password","¡Bie nvenido ","texto del body","de quien","para quien","","1","HTML") |