• 软件测试技术
  • 软件测试博客
  • 软件测试视频
  • 开源软件测试技术
  • 软件测试论坛
  • 软件测试沙龙
  • 软件测试资料下载
  • 软件测试杂志
  • 软件测试人才招聘
    暂时没有公告

字号: 小 中 大 | 推荐给好友 上一篇 | 下一篇

asp发送html邮件中加入图片

发布: 2007-6-30 18:56 | 作者: admin | 来源: | 查看: 19次 | 进入软件测试论坛讨论

领测软件测试网 这个木鸟以前试验过,但没成功,最后改成http连接图片,看看你能成功不,成功了记得告诉大家

1 <HTML>  
2  
3 <body bgcolor=white>  
4  
5 <%  
6  
7 if request.ServerVariables("REQUEST_METHOD") = "GET" then  
8  
9 %>  
10  
11 <form action="htmlemail.asp" method=post>  
12 <font face=verdana>  
13 Your Name <input type="text" name="strName"> Your EMail <input type="text" name="strEmail">  
14 <br>  
15 Recipient Email <input type="text" name="strTo">  
16 <p>  
17  
18 <textarea cols=40 rows=4 name=message>Your message</textarea>  
19  
20 </p>  
21  
22 <input type=submit name=send value=Send>  
23  
24 </form>  
25  
26 <%  
27  
28 else  
29  
30 Set objMail = Server.CreateObject("CDONTS.NewMail")  
31 objMail.Importance = 1  
32 objMail.From = request("strName") & "<" & request("strEmail") & ">"  
33 objMail.To = request("strTo")  
34 objMail.Subject = "Example of HTML EMail with Embeded Image"  
35  
36 @# this is my messages HTML  
37 strMsg = "" & _  
38 "<html><body bgcolor=red>" & _  
39 "<a href=""
40 "</a><p><font face=verdana>Example of a HTML Email with embedded Image<P><br>" & _  
41 request("message") & _  
42 "</body></html>"  
43  
44 @# Set the format of the email to html, etc  
45 objMail.BodyFormat = 0  
46 objMail.MailFormat = 0  
47 objMail.Body = strMsg  
48  
49 @# attach our image file and Set the url to simply logo.gif  
50 objMail.AttachURL server.MapPath("logo.gif"), "logo.gif"  
51 objMail.Send  
52  
53 @# destroy the email object  
54 Set objMail = Nothing  
55  
56 %>  
57 <h1>  
58 <font face=verdana>Message Sent, Thanks!</font>  
59 </h1>  
60  
61 <% end if %>

文章来源于领测软件测试网 https://www.ltesting.net/


关于领测软件测试网 | 领测软件测试网合作伙伴 | 广告服务 | 投稿指南 | 联系我们 | 网站地图 | 友情链接
版权所有(C) 2003-2010 TestAge(领测软件测试网)|领测国际科技(北京)有限公司|软件测试工程师培训网 All Rights Reserved
北京市海淀区中关村南大街9号北京理工科技大厦1402室 京ICP备2023014753号-2
技术支持和业务联系:[email protected] 电话:010-51297073

软件测试 | 领测国际 | ISTQB | ISTQB官网 | TMMi | TMMi认证 | 国际软件测试工程师认证 | 领测软件测试网