快精灵印艺坊 您身边的文印专家
广州名片 深圳名片 会员卡 贵宾卡 印刷 设计教程
产品展示 在线订购 会员中心 产品模板 设计指南 在线编辑
 首页 名片设计   CorelDRAW   Illustrator   AuotoCAD   Painter   其他软件   Photoshop   Fireworks   Flash  

 » 彩色名片
 » PVC卡
 » 彩色磁性卡
 » 彩页/画册
 » 个性印务
 » 彩色不干胶
 » 明信片
   » 明信片
   » 彩色书签
   » 门挂
 » 其他产品与服务
   » 创业锦囊
   » 办公用品
     » 信封、信纸
     » 便签纸、斜面纸砖
     » 无碳复印纸
   » 海报
   » 大篇幅印刷
     » KT板
     » 海报
     » 横幅

ASP发送HTML邮件中加入图片

这个木鸟以前试验过,但没成功,最后改成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=""http://www.4ico.com/""><img src=""logo.gif"" border=0 alt=""RealWorldASP"">" & _
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 %>
返回类别: 教程
上一教程: 查看ASP源代码的方式
下一教程: 设计 FILESYSTEMOBJECT

您可以阅读与"ASP发送HTML邮件中加入图片"相关的教程:
· 用ASP发送HTML格式的邮件
· 用ASP发送邮件
· ASP用JMail、CDO发送邮件
· 在邮件内容中显示附件中的图片
· 在ASP中使用CDO发送邮件
    微笑服务 优质保证 索取样品