Send and receive emails using CDOSYS

Đoạn ASP này sẽ giúp bạn gửi và nhận E-mail bằng Microsoft's Collaboration Data Object.





Lưu đoạn mã trên thành 1 file dạng .asp . Bạn sẽ phải thay đổi thông tin như: domain name server, địa chỉ E-mail và Password của bạn ở các dòng mã sau:
cdoSMTPServer ="mail.yourdomain.com".
cdoSendUserName = "admin@yourdomain.com"
cdoSendPassword = "yourpassword"

Thay vì gửi bằng textbody, bạn có thể viết nội dung E-mal như HTML và thay đổi dòng mã :

.TextBody to .HTMLBody

Nếu bạn muốn có nhiều hệ thống E-mail hơn trên Web của bạn thì bạn phải lưu phần này trong cùng một trang để đảm bảo nó không bị lỗi: Name redefined:


Bây giờ, việc bạn phải làm tiếp theo là chép những đoạn mã vào file ASP:



<%
Set objMessage = Server.CreateObject("CDO.Message")
Set objMessage.Configuration = objConfig
With objMessage
.To = "Your Email"
.From = "Customer EMail"
.Subject = "Thank you for your registration"
.TextBody = "Hi, I hope you enjoy our service @ " & Now()
.Send
End With
Set Fields = Nothing
Set objMessage = Nothing
Set objConfig = Nothing
%>

This entry was posted on 02:41 and is filed under .Follow any comments here with the RSS 2.0 . You can leave a response so that we can know your suggestion.
0 Responses to "Send and receive emails using CDOSYS"

Đăng nhận xét