Combine Delphi and ASP to send emails

Source: Internet
Author: User

Program aspsendmail;

Uses urlmon;

Begin

Urldownloadtofile (nil, pchar ('HTTP: // www. *****. com/Good. asp? Data = use the server to send emails '), 0, 0, nil );

End.

 

The following are all the code examples of good. asp:

<%

Dim senddata
Senddata = request ("data ")
If senddata = "" Then senddata = Time ()

Call sendemail ("sebooks@163.com", "subject", senddata, "sebooks@163.com ")

Sub sendemail (toemail, subject, content, fromemail)
Set jmail = server. Createobject ("jmail. Message ")
Jmail. Silent = true
Jmail. Logging = true
Jmail. charset = "gb2312"
Jmail. contenttype = "text/html"
Jmail. addrecipient toemail
Jmail. From = fromemail
Jmail. Subject = subject
Jmail. Body = content
'Jmail. prority = 1' urgent program of the mail. The value 1 indicates the fastest, the value 5 indicates the slowest, and the value 3 indicates the default value.

Jmail. mailserverusername = "sebooks" 'user name required to log on to the email server
Jmail. mailserverpassword = "Hey, my password cannot be" 'Password required to log on to the email server
Jmail. Send ("smtp.163.com") 'executes the mail sending (via the mail server address)

Jmail. Close () 'Close the object
Set jmail = nothing
End sub

%>

Save the above content as an ASP file and put it in a virtual space. of course, the premise is that the server has jmail. this is generally supported by domestic space .... just put a few spaces away .... haha.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.