עמוד ראשי » זירת השאלות » שליחת דואר באמצעות האובייקט CDONTS506צפיות4תשובותשליחת דואר באמצעות האובייקט CDONTS צוות האתר, 17 באפריל, 2002מאמר חדש במדור ASPשליחת דואר באמצעות האובייקט CDONTSמאת זהר פלדלחץ כאן לצפיה במאמרתגובות למאמר יש לשרשר להודעה זותגיות: פורום צד שרת
4 תשובות
IIS7 והעברת ערכים
האם הקוד עובד גם ב-IIS7?
איך מעבירים ערכים מטופס לקוד שליחת האובייקט?
אתר אימון: http://www.CoachEfrat.com/
אתר צילום: http://www.EfratNakash.com/
ב-IIS7 יש אובייקט אחר – CDOSYS
אלי ענתבי
לא הצלחתי עם CDO
ניסיתי עם הקוד הבא, וגם כאן קיבלתי הודעת שגיאה:
500 (Internal Server) Error
האם תוכל למצוא את השגיאה?
<%@language="VBSCRIPT" CODEPAGE="1255"%>
<%
firstname = Request.Form("firstName")
lastname = Request.Form("lastName")
email = Request.Form("email")
subject = Request.Form("subject")
content = Request.Form("content")
if (firstname <> "") then
' build HTML for message body
strHTML = "<html dir=rtl>"
strHTML = strHTML & "<head></head>"
strHTML = strHTML & "<body>"
strHTML = strHTML & "אתר: אפרת נקש אימון להשגת יעדים <br>"
strHTML = strHTML & "שם פרטי: " & firstname & "<br>"
strHTML = strHTML & "שם משפחה: " & lastname & "<br>"
strHTML = strHTML & "אימייל: " & email & "<br>"
strHTML = strHTML & "נושא: " & subject & "<br>"
strHTML = strHTML & "תוכן ההודעה: " & content & "<br>"
strHTML = strHTML & "</body>"
strHTML = strHTML & "</html>"
Set objEmail = CreateObject("CDO.Message")
objEmail.From = "[email protected]"
objEmail.To = "[email protected]"
objEmail.Subject = subject
objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing"😉 = 1
objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverpickupdirectory"😉 = "c:inetpubmailrootpickup"
objEmail.Configuration.Fields.Update
objEmail.Bodypart.ContentMediaType = "text/html"
objEmail.Bodypart.ContentTransferEncoding = "Quoted-Printable"
objEmail.Bodypart.Charset= "windows-1255"
SET Stm = objEmail.Bodypart.GetDecodedContentStream
Stm.WriteText strHTML
Stm.Flush
objEmail.Send
set objmail=nothing
end if
%>
אתר אימון: http://www.CoachEfrat.com/
אתר צילום: http://www.EfratNakash.com/
הבעיה נפתרה
החלפתי את הפרמטרים של השרת, וזה עובד:
objEmail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing")=2
'Name or IP of remote SMTP server
objEmail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver"😉 _
="smtp.server.com"
'Server port
objEmail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport"😉 _
=25
אתר אימון: http://www.CoachEfrat.com/
אתר צילום: http://www.EfratNakash.com/