UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Adding Invisible 'headers' Into An Email, Access 2016    
 
   
MisterChips
post Aug 6 2018, 12:22 PM
Post#1



Posts: 62
Joined: 29-January 17



Hi there.
I am using the below VBA to build emails which are then sent to SocketLabs SMTP .

SocketLabs provide a good tracking system to show opened, clicked emails etc. (Which is very handy!)
I would like to increase this functionality to identify MailingGroup ID's and Message ID's

SocketLabs have suggested that code similar to the below might be a way of doing it.

imsg.X-xsMessageId: [Your Value]
imsgX-xsMailingId: [Your Value]
(They are not in the business of writing my code for me, and I am very grateful for the help they have given me thus far).

I have tried a number of versions of their suggestion to get these 'tags' into my messages.
None of them have worked thus far.

Can anyone direct me to a place where I can read up on how to do this please?

Is it possible to add html code to my message somewhere so that the tags can be picked up by SocketLabs but be invisible to my 'To' parties


The code I use to get 'stuff' to Socketlabs is set up in a Microsoft Access database like this:-

Set imsg = CreateObject("CDO.Message")
Set iconf = CreateObject("CDO.Configuration")
Set flds = iconf.Fields
schema = "http://schemas.microsoft.com/CDO/configuration/"
flds.Item(schema & "sendusing") = cdoSendUsingPort
flds.Item(schema & "smtpserver") = "smtp.socketlabs.com"
flds.Item(schema & "smtpserverport") = 25
flds.Item(schema & "smtpauthenticate") = cdoBasic ' "Auth" 'cdoBasic
flds.Item(schema & "sendusername") = "server19573"
flds.Item(schema & "sendpassword") = "?????????????"
flds.Item(schema & "smtpusessl") = 1
flds.Update
SMTPname = "SocketLabs"

Then lines such as these:-

imsg.X-xsMessageId = me.combo247 ' doesn't work!
imsg.X-xsMailingId = me.MembNo 'doesn't work!

imsg.From = "dave@dfparker.co.UK"
imsg.To = rsEmail!email
imsg.Subject = SubjectText
imsg.CC = SendCC
imsg.BCC = SendBCC
imsg.HTMLBody = BodyText
etc. etc
imsg.Send

Any advice will be warmly received.

Thanks in advance. Dave Parker
Go to the top of the page
 
PhilS
post Aug 6 2018, 12:35 PM
Post#2



Posts: 515
Joined: 26-May 15
From: The middle of Germany


I would try something along the lines of...

CODE
imsg.Fields("urn:schemas:mailheader:X-xsMessageId") = me.YouShouldUseABetterNameForYourControlsThanCombo247
imsg.Fields.Update

The part following urn:schemas:mailheader: is the name for your customer header.
Go to the top of the page
 
MisterChips
post Aug 7 2018, 03:59 AM
Post#3



Posts: 62
Joined: 29-January 17



Many thanks PhilS

You put me on the right track.
With that snippet of code I was able to Google and learn a lot more about CDO, for which I thank you.

Regarding Combo247.
I appreciate that it is more elegant to use descriptive names for the combo boxes.
When I have tried to do so I have found it takes me longer to code, and I tend to introduce typing errors.

What I do, is print out a copy of the form design screen and refer to that whenever I want to play with code.
Not a purist's answer, I will admit, but it seems to work better for me.

Once again, I appreciate the time spent sorting out my header tag problem.

Have a good day.
Go to the top of the page
 
cheekybuddha
post Aug 7 2018, 04:12 AM
Post#4


UtterAccess VIP
Posts: 10,538
Joined: 6-December 03
From: Telegraph Hill


>> You put me on the right track. <<

Are you able to share that track?
Go to the top of the page
 
MisterChips
post Aug 8 2018, 09:33 AM
Post#5



Posts: 62
Joined: 29-January 17




Yes cheekybuddha

I could have used the code as a copy and paste from PhilS, but I wanted to try and understand the process as well.

I googled urn:schemas:mailheader: and realised that there was a lot more to CDO than I originally realised.

I was particularly thankful to PhilS for giving me the lead into understanding that.

Go to the top of the page
 


Custom Search


RSSSearch   Top   Lo-Fi    14th November 2018 - 05:29 PM