473,473 Members | 2,155 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Extra mail header with CDO from .asp side - how to do this

I have the below function witch I use to send mail to reciptents on my
maillist from an .asp side
I am about to make a bounce back system - and would therefore like to
make one extra MailHeader witch my bounce back system can take out -
But I have no luck with adding the extra header

-----------------------------------------
Sub sendmail

'Dimension variables
Dim objCDOSYSCon, objCDOSYSMail

'Create the e-mail server object
Set objCDOSYSMail = Server.CreateObject("CDO.Message")
Set objCDOSYSCon = Server.CreateObject ("CDO.Configuration")

'Out going SMTP server
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver")
= "localhost"
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport")
= 25
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing")
= 2
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout")
= 60

' Here I would like to include a extra header with the userID value -
but the below code don´t work.

'
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/mailheader:UserID")
= UserIDValue

objCDOSYSCon.Fields.Update

'Update the CDOSYS Configuration
Set objCDOSYSMail.Configuration = objCDOSYSCon
objCDOSYSMail.From = from
objCDOSYSMail.To = email
objCDOSYSMail.cc = emailcc
objCDOSYSMail.bcc = emailbcc
objCDOSYSMail.ReplyTo = ReplyTo

objCDOSYSMail.Subject = Subject

objCDOSYSMail.HTMLBody = Txt

objCDOSYSMail.Send

'Close the server mail object
Set objCDOSYSMail = Nothing
Set objCDOSYSCon = Nothing

End Sub

Oct 15 '06 #1
3 12039
>>>>>>>>>>>>>>>>>>
"majlandt" <ma******@gmail.comwrote in message
news:11**********************@k70g2000cwa.googlegr oups.com...
I have the below function witch I use to send mail to reciptents on my
maillist from an .asp side
I am about to make a bounce back system - and would therefore like to
make one extra MailHeader witch my bounce back system can take out -
But I have no luck with adding the extra header

-----------------------------------------
Sub sendmail

'Dimension variables
Dim objCDOSYSCon, objCDOSYSMail

'Create the e-mail server object
Set objCDOSYSMail = Server.CreateObject("CDO.Message")
Set objCDOSYSCon = Server.CreateObject ("CDO.Configuration")

'Out going SMTP server
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserv
er")
= "localhost"
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserv
erport")
= 25
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/sendusin
g")
= 2
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpconn
ectiontimeout")
= 60

' Here I would like to include a extra header with the userID value -
but the below code don´t work.

'
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/mailhead
er:UserID")
= UserIDValue

objCDOSYSCon.Fields.Update

'Update the CDOSYS Configuration
Set objCDOSYSMail.Configuration = objCDOSYSCon
objCDOSYSMail.From = from
objCDOSYSMail.To = email
objCDOSYSMail.cc = emailcc
objCDOSYSMail.bcc = emailbcc
objCDOSYSMail.ReplyTo = ReplyTo

objCDOSYSMail.Subject = Subject

objCDOSYSMail.HTMLBody = Txt

objCDOSYSMail.Send

'Close the server mail object
Set objCDOSYSMail = Nothing
Set objCDOSYSCon = Nothing

End Sub
<<<<<<<<<<<<<<<<<<<<<

First don't try adding headers to the configuration object. Add them to the
message object fields collection.
Second always prefix your custom headers with 'x-' to avoid aliasing with
any other SMTP header and it's probably best to use an additional prefix is
you are using a common concept like userID.

E.G., x-mycompany-userid


Oct 15 '06 #2

Anthony Jones wrote:
>>>>>>>>>>>>>>>>>
"majlandt" <ma******@gmail.comwrote in message
news:11**********************@k70g2000cwa.googlegr oups.com...
I have the below function witch I use to send mail to reciptents on my
maillist from an .asp side
I am about to make a bounce back system - and would therefore like to
make one extra MailHeader witch my bounce back system can take out -
But I have no luck with adding the extra header

-----------------------------------------
Sub sendmail

'Dimension variables
Dim objCDOSYSCon, objCDOSYSMail

'Create the e-mail server object
Set objCDOSYSMail = Server.CreateObject("CDO.Message")
Set objCDOSYSCon = Server.CreateObject ("CDO.Configuration")

'Out going SMTP server
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserv
er")
= "localhost"
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserv
erport")
= 25
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/sendusin
g")
= 2
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpconn
ectiontimeout")
= 60

' Here I would like to include a extra header with the userID value -
but the below code don´t work.

'
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/mailhead
er:UserID")
= UserIDValue

objCDOSYSCon.Fields.Update

'Update the CDOSYS Configuration
Set objCDOSYSMail.Configuration = objCDOSYSCon
objCDOSYSMail.From = from
objCDOSYSMail.To = email
objCDOSYSMail.cc = emailcc
objCDOSYSMail.bcc = emailbcc
objCDOSYSMail.ReplyTo = ReplyTo

objCDOSYSMail.Subject = Subject

objCDOSYSMail.HTMLBody = Txt

objCDOSYSMail.Send

'Close the server mail object
Set objCDOSYSMail = Nothing
Set objCDOSYSCon = Nothing

End Sub
<<<<<<<<<<<<<<<<<<<<<

First don't try adding headers to the configuration object. Add them to the
message object fields collection.
Second always prefix your custom headers with 'x-' to avoid aliasing with
any other SMTP header and it's probably best to use an additional prefix is
you are using a common concept like userID.

E.G., x-mycompany-userid
ok, but how do I do that then
I dont know where to do that or how to do it

Oct 15 '06 #3
>
>First don't try adding headers to the configuration object. Add them to
the
>message object fields collection.
Second always prefix your custom headers with 'x-' to avoid aliasing
with
>any other SMTP header and it's probably best to use an additional prefix
is
>you are using a common concept like userID.

E.G., x-mycompany-userid

ok, but how do I do that then
I dont know where to do that or how to do it
You were pretty close:-

objCDOSYSMail.Fields("urn:schemas:mailheader:x-mycompany-userid") =
UserIDValue
objCDOSYSMail.Fields.Update

Oct 17 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Ronald Fischer | last post by:
Could someone explain to me what is the difference between <!ENTITY % Foo 'Bar' > and <!ENTITY Foo 'Bar' > From my understanding, the "macro" Foo has to be referenced in the first case...
0
by: Fabrice DG | last post by:
Hi all. I don't know if this post is really at the right place but I hope someone can help me.. I developed a NT service, in order to automate mail exchanges between different kind of users This...
4
by: Roger | last post by:
I would like to make my column header go verticle instead of horizontal. Is this an easy task in asp.net. (Actually using Visual Studio.net 2003). thanks, Rog
1
by: oni | last post by:
hi all, the program should be able to log on to a pop mail account and need to just read its headers and display. any help in this regard highly apperecialted. code pref VB.NET thankz in...
1
by: asnowfall | last post by:
I am creating MailMessage out of already existing email message. My existing message has few custom properties. I wan to add them to System.Net.Mail.MailMessage How to add custom properties? ...
2
by: clevrmnkey | last post by:
I've had nothing but trouble from the System.Net.Mail objects, but I finally need to make them work, and I can't for the life of me see what I'm doing wrong. I pared back my mail transaction to...
6
by: Tim Arnold | last post by:
Hi, I'm using ElementTree which is wonderful. I have a need now to write out an XML file with these two headers: <?xml version="1.0" encoding="UTF-8" ?> <?NLS TYPE="org.eclipse.help.toc"?> My...
1
by: Reporter | last post by:
I can remove the 401 header line in the following code and it operates exactly the same. <?php if (!isset($_SERVER)) { //header('WWW-Authenticate: Basic realm="My Realm"'); header('HTTP/1.0...
1
realin
by: realin | last post by:
Hiya all, I m using pop3.class.php5.inc class from php classes I am using their simple script, but i cant really get the sender information in the headers. Wht can be the error, i am able to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.