2016-03-22 3 views
0

Kann ich die folgende Konfiguration verwenden? Ich denke, http://schemas.microsoft.com/cdo/configuration wurde eingestellt.So senden Sie eine E-Mail über einen Remote-Server mit CDOSYS

<% 
Set myMail=CreateObject("CDO.Message") 
myMail.Subject="Sending email with CDO" 
myMail.From="[email protected]" 
myMail.To="[email protected]" 
myMail.TextBody="This is a message." 
myMail.Configuration.Fields.Item _ 
("http://schemas.microsoft.com/cdo/configuration/sendusing")=2 
'Name or IP of remote SMTP server 
myMail.Configuration.Fields.Item _ 
("http://schemas.microsoft.com/cdo/configuration/smtpserver")="smtp.server.com" 
'Server port 
myMail.Configuration.Fields.Item _ 
("http://schemas.microsoft.com/cdo/configuration/smtpserverport")=25 
myMail.Configuration.Fields.Update 
myMail.Send 
set myMail=nothing 
%> 
+0

Was passiert, wenn Sie es laufen? – mikeyq6

+0

Es sollte kein Problem mit schemas.microsoft.com/cdo/configuration/ geben. Welche Fehlermeldung erhalten Sie? Es ist wahrscheinlich ein Fall, dass Sie falsche Konfigurationseinstellungen für den spezifischen SMTP-Server verwenden, den Sie verwenden - zB erfordert es eine Authentifizierung? Diese Seite ist nützlich - http://www.powerasp.net/content/new/sending_email_cdosys.asp – John

Antwort

0

Versuchen Sie Folgendes:

<% 
Set myMail=CreateObject("CDO.Message") 
myMail.Subject="Sending email with CDO" 
myMail.From="[email protected]" 
myMail.To="[email protected]" 
myMail.TextBody="This is a message." 
myMail.Configuration.Fields.Item _ 
("http://schemas.microsoft.com/cdo/configuration/sendusing")=2 
'Name or IP of remote SMTP server 
myMail.Configuration.Fields.Item _ 
("http://schemas.microsoft.com/cdo/configuration/smtpserver")="smtp.server.com" 
'Server port 
myMail.Configuration.Fields.Item _ 
("http://schemas.microsoft.com/cdo/configuration/smtpserverport")=25 
myMail.Configuration.Fields.Item _ 
("http://schemas.microsoft.com/cdo/configuration/sendusername") = "your-email-from-want-to-send-mail" 
myMail.Configuration.Fields.Item _ 
("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "your-email-password" 
myMail.Configuration.Fields.Item _ 
("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 

myMail.Configuration.Fields.Update 
myMail.Send 
set myMail=nothing 
%> 
+0

Funktioniert immer noch nicht. Ist nicht wegen des Schemas http://schemas.microsoft.com/cdo/configuration/ nicht mehr verfügbar? – DONSA