Setting the Reply-To Header in an Email using CDONTS.NewMail Object and CDO Message
                                                            生活随笔
收集整理的這篇文章主要介紹了
                                Setting the Reply-To Header in an Email using CDONTS.NewMail Object and CDO Message
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.                        
                                
                            
                            
                            代碼  ?1?<%
?2?Option?Explicit
?3?
?4?Dim?objMail
?5?Dim?strSubject
?6?Dim?strBody
?7?
?8?strSubject?=?"This?is?a?test?email"
?9?strBody????=?"This?test?email?is?using?test@devasp.com?"?&?_
10????????????"?as?the?sender?email?address?but?we?are?"?&?_
11????????????"?using?someone@devasp.com?as?the?Reply-To?header."
12?
13??????
14?'?First?create?an?instance?of?NewMail?Object
15?Set?objMail?=?Server.CreateObject("CDONTS.NewMail")
16?
17?'?Please?replace?the?"From"?and?"To"?email?addresses?with?your?
18?'?own?valid?email?address.?I?recieve?too?many?emails?
19?'?from?people?who?test?this?sample?and?keep?sending?
20?'?emails?to?test@devasp.com,?or?they?keep?the?"From"?property
21?'?as?webmaster@devasp.com?and?I?get?response?of?
22?'?undeliverable?emails.
23?'?NOTE:?If?the?"To"?or?"From"?properties?of?CDONTS?contain?
24?'?invalid?email?address?you?will?not?recieve?the?email.
25??
26?objMail.From?=?"test@dupcit.com"
27?objMail.To???=?"webmaster@dusystem.com"
28?
29?'?Use?the?value?property?of?the?CDONTS.NewMail?Object
30?'?to?Set?the?Reply-To?header
31?
32?objMail.Value("Reply-To")?=?"someone@dusystem.com"?'回復郵件地址
33?
34?objMail.Subject?=?strSubject
35?objMail.Body????=?strBody
36?
37?objMail.Send
38?
39?Set?objMail?=?Nothing
40?%>
41?
42?
43??
44?
45?<%?
46?
47?strText?=?"Test"?
48?
49?Const?cdoSendUsingPort?=?2?
50?
51?Const?strSmartHost?=?"myLocalSMTPHost"?
52?
53?Set?myMail?=?CreateObject("CDO.Message")?
54?
55?Set?iConf?=?myMail.Configuration?
56?
57?With?iConf.Fields?
58?
59?.item("http://schemas.microsoft.com/cdo/configuration/sendusing")?=?cdoSendUsingPort?
60?
61?.item("http://schemas.microsoft.com/cdo/configuration/smtpserver")?=?strSmartHost?
62?
63?.Update?
64?
65?End?With?
66?
67?With?iConf.Fields?
68?
69?.item("http://schemas.microsoft.com/cdo/configuration/sendusing")?=?cdoSendUsingPort?
70?
71?.item("http://schemas.microsoft.com/cdo/configuration/smtpserver")?=?strSmartHost?
72?
73?.Update?
74?
75?End?With?
76?
77?With?myMail?
78?
79?myMail.From?=?"geovindu@dupcit.com"?
80?
81?myMail.To?=?"bill@dupcit.com"?
82?
83?myMail.ReplyTo?=?"bill@dusystem.com"??'回復郵件地址
84?
85?myMail.Subject?=?"Internet?Communication?from?Me"?
86?
87?myMail.HTMLBody?=?strText?
88?
89?myMail.Send?
90?
91?End?With?
92?
93?Set?myMail?=?Nothing?
94?
95?%>?
96?
97?
                        
                        
                        ?2?Option?Explicit
?3?
?4?Dim?objMail
?5?Dim?strSubject
?6?Dim?strBody
?7?
?8?strSubject?=?"This?is?a?test?email"
?9?strBody????=?"This?test?email?is?using?test@devasp.com?"?&?_
10????????????"?as?the?sender?email?address?but?we?are?"?&?_
11????????????"?using?someone@devasp.com?as?the?Reply-To?header."
12?
13??????
14?'?First?create?an?instance?of?NewMail?Object
15?Set?objMail?=?Server.CreateObject("CDONTS.NewMail")
16?
17?'?Please?replace?the?"From"?and?"To"?email?addresses?with?your?
18?'?own?valid?email?address.?I?recieve?too?many?emails?
19?'?from?people?who?test?this?sample?and?keep?sending?
20?'?emails?to?test@devasp.com,?or?they?keep?the?"From"?property
21?'?as?webmaster@devasp.com?and?I?get?response?of?
22?'?undeliverable?emails.
23?'?NOTE:?If?the?"To"?or?"From"?properties?of?CDONTS?contain?
24?'?invalid?email?address?you?will?not?recieve?the?email.
25??
26?objMail.From?=?"test@dupcit.com"
27?objMail.To???=?"webmaster@dusystem.com"
28?
29?'?Use?the?value?property?of?the?CDONTS.NewMail?Object
30?'?to?Set?the?Reply-To?header
31?
32?objMail.Value("Reply-To")?=?"someone@dusystem.com"?'回復郵件地址
33?
34?objMail.Subject?=?strSubject
35?objMail.Body????=?strBody
36?
37?objMail.Send
38?
39?Set?objMail?=?Nothing
40?%>
41?
42?
43??
44?
45?<%?
46?
47?strText?=?"Test"?
48?
49?Const?cdoSendUsingPort?=?2?
50?
51?Const?strSmartHost?=?"myLocalSMTPHost"?
52?
53?Set?myMail?=?CreateObject("CDO.Message")?
54?
55?Set?iConf?=?myMail.Configuration?
56?
57?With?iConf.Fields?
58?
59?.item("http://schemas.microsoft.com/cdo/configuration/sendusing")?=?cdoSendUsingPort?
60?
61?.item("http://schemas.microsoft.com/cdo/configuration/smtpserver")?=?strSmartHost?
62?
63?.Update?
64?
65?End?With?
66?
67?With?iConf.Fields?
68?
69?.item("http://schemas.microsoft.com/cdo/configuration/sendusing")?=?cdoSendUsingPort?
70?
71?.item("http://schemas.microsoft.com/cdo/configuration/smtpserver")?=?strSmartHost?
72?
73?.Update?
74?
75?End?With?
76?
77?With?myMail?
78?
79?myMail.From?=?"geovindu@dupcit.com"?
80?
81?myMail.To?=?"bill@dupcit.com"?
82?
83?myMail.ReplyTo?=?"bill@dusystem.com"??'回復郵件地址
84?
85?myMail.Subject?=?"Internet?Communication?from?Me"?
86?
87?myMail.HTMLBody?=?strText?
88?
89?myMail.Send?
90?
91?End?With?
92?
93?Set?myMail?=?Nothing?
94?
95?%>?
96?
97?
?
?
轉載于:https://www.cnblogs.com/geovindu/archive/2010/01/29/1659308.html
總結
以上是生活随笔為你收集整理的Setting the Reply-To Header in an Email using CDONTS.NewMail Object and CDO Message的全部內容,希望文章能夠幫你解決所遇到的問題。
 
                            
                        - 上一篇: Firefox 的User Agent
- 下一篇: 天空套多少钱一套啊?
