Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi guys I have a macro to send emails in vbscript like this:
Dim objEmail
objEmail.To = mailto (mailto is a variable with the mail )
objEmail.From = getVariable("vEmailFrom")
objEmail.Sender = getVariable("vEmailAlias")
objEmail.Subject = mailSubject
objEmail.TextBody = ""
What I'm trying to do is to change the header of the mail.
As default my mail shows the name of the username who sends the email, but I want to change the header whenever I want. Any ideas ?
I want something like :
objEmail.setNewMailHeader = "Hello Header Mail")
But I've found no property to change the header of the email.
If anybody knows how to do it, I'll appreciate that.
Many thanks in advance!!!
Hi,
I found the solution for your Query,
I tried it and its working fine for me
just use the below line and it will change header for you,
objEmail.From = """Hi How are you"" <yourcompany@domain.com>"
Hope this will help for you,
Thanks
hmmm
objEmail.Subject = mailSubject - that is the header definition
so if You just write:
objEmail.Subject = "Hello Header Mail"
should be ok
Thanks Pari for your response,
I don't think this is the header, this is just the subject of the message.
The structure is the following :
<header> <hour the email was sent>
<subject>
Where the header is usually the name of the account which sends the message.
This is an example :
If you know the answer, I'll apreciate your help.
Regards, Marcel.
Hi,
you can use Variable to store temporary your mail header like,
Dim VmailSubject
VmailSubject = "Hello Header Mail"
objEmail.Subject = VmailSubject
you can change variable value dynamically according to your logic,
Hope this will help you,
Thanks
I appreciate your answers.
My problem is not the subject, is the header.
if you see the image attached above, you'll see what I'm talking about.
Header -> Marcel Olmo Arnaiz.
Subject -> Hello, this is an example.
ok so try this:
objEmail.From = "Barack Obama"
Hi,
I found the solution for your Query,
I tried it and its working fine for me
just use the below line and it will change header for you,
objEmail.From = """Hi How are you"" <yourcompany@domain.com>"
Hope this will help for you,
Thanks
Thanks Raj N, as easy as it sounds!!
Regards, Marcel.