473,320 Members | 1,861 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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 12021
>>>>>>>>>>>>>>>>>>
"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: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.