Using Redemption to write message header - outlook

I have someone that is using MSAccess to send out emails and are using the Redemption library to help with putting together the email message.
However a new requirement has emerged where they will need to write some custom headers in the email message before sending.
The code is using RDO.Item to build the body of the email message.
I have seen some other suggestions where VBA and Outlook are used that after getting a MAPI session they have used .PropertyAccessor. methods to write items to the headers but I am unsure if this is possible via Redemption's MAPIOBJECT.
Is this something that the Redemption library is able to support?
Thanks in advance!

All you need to do is something like the following:
YouRDOMailObject.Fields["http://schemas.microsoft.com/mapi/string/{00020386-0000-0000-C000-000000000046}/X-MyCustomHeader"] = "Some value";

Related

Gmail New Threading Policy requires workaround - how to fix?

Per this announcement - https://gsuiteupdates.googleblog.com/2019/03/threading-changes-in-gmail-conversation-view.html -- an email with the exact same from/to and subject will no longer thread in Gmail if the emails are system generated unless we somehow reference the original message information in the subsequent system generated emails.
Does anyone have ideas for how we would do this in CDO mail using ASP / VBScript? Am guessing we would have to call a Google API to get the message ID after it created the message as well.
Google was not able to provide any help over and above the language used in this blog article which was as below:
Additional details
If you are managing a system that sends email notifications to users
and want your emails to be threaded in Gmail conversation view, then
you have to ensure that your notifications:
1) Have the same subject
2) Have reference headers that reference IDs seen earlier in the
thread, or have references headers that consistently refer to the same
message ID
Ideas are appreciated.
I'm not sure why you're looking for any sort of Google API, this sounds to be the standard "References" and "In-Reply-To" headers that any email reply should have. Refer to section 3.6.4 "Identification Fields" in RFC 5322. To create this you'd need to read the Message-ID header of the email being replied to and use it in the References header.
Just read the Message-ID of the email you're replying to like any other header:
Dim OriginalMessageId as String
OriginalMessageId = originalEmail.Fields.Item("urn:schemas:mailheader:message-id")
And use it to create the References headers in your new email:
replyEmail.Fields.Item("urn:schemas:mailheader:references") = OriginalMessageId
replyEmail.Fields.Item("urn:schemas:mailheader:in-reply-to") = OriginalMessageId
If you need more of a pointer of how this would work, you might need to include more of the code of how you're reading a message and how you're replying to it.

VB6 How to Suppress Security Message with MAPI Control

This is the most common message we face, i have seen the code to resolve this by other means, but don't have an idea how to resolve this by using MAPIMessages Control. Please help
"A program is trying to access e-mail address information stored in outlook...."
"A program is trying to send an email message on your behalf...."
I use Redemption with VB6 to get around this.
http://www.dimastr.com/redemption/home.htm

What's the easiest way to send a message through Outlook with Ruby?

My work requires me to automate e-mail generation for certain tests. I've been looking around but havent been able to find a reasonable solution that can be implemented quickly. It needs to be in outlook and not some other mail server as we have some strange authentication rules in place, and we need the option of saving drafts instead of just sending the message.
Apparently win32ole can do this, but I can't find any reasonably simple examples.
Assuming that the Outlook credentials are stored and you are set to autologin to Outlook, WIN32OLE does the trick quite nicely:
require 'win32ole'
outlook = WIN32OLE.new('Outlook.Application')
message = outlook.CreateItem(0)
message.Subject = "Hey look a subject!"
message.Body = "Yes this is dog"
message.Recipients.Add 'dog#dog.com'
message.Recipients.Add 'cat#dog.com'
message.Attachments.Add('C:\Path\To\File.txt')
#Want to save as a draft?
message.Save
#Want to send instead?
message.Send
This is in fact quite well documented in "Automating Outlook with Ruby: Saving Mail Messages To Files", as is automating the rest of windows with Ruby.
You may have an authorization issue, which, if it appears, can be solved using "Advanced Security for Outlook".
If the Outlook account has web access (via outlook.com or office365.com) you can also use Mikel Lindsaar's Ruby email library. It works well for many different email providers that allow POP3, IMAP4, or SMTP connections.
I posted an entry with some sample code on sending and receiving Outlook email via Ruby that might help. Sorry, I can't comment on how to save drafts, though.

SMTP Problem with vb6

I am developing SMTP Client to send email from my application.
I am able to send email but From field in the inbox of the destination email was empty.
It is showing (unknown sender).
Please suggest a workaround.
You need to add a
"From: NAME <EMAIL>" & vbCrLf
To your header string.
Also, be sure to check out vbSendMail.dll. Not only is it a complete working dll you can just reuse - you also have the source to consult in case you insist (great learning experience?) on writing this by yourself.

Is it possible to send an e-mail using the VS2010 development server?

Is it possible to send an e-mail using the VS2010 development server? If that's possible, can someone point me to a sample the web?
I'd like to send an e-mail to the person who register so to keep a proof that we (yes or not) received his request. The e-mail will contains a few pertinent info, such as the name, time, and son on.
EDIT
At my work, we collect data and to whoever needs as long as the ministry we work for tells as to do so. After we receive the paper form, we write an e-mail to the form sender. Until now, we use a paper form to know who needs data. I'd like to put that form online and also be able to generate an e-mail to the sender of the request. So, since I'm still developing the application, I need to test how sending the e-mail will work. That's why I'm asking if I can send an e-mail, for instance, to my Yahoo account from my laptop using VS2008 web development server.
I remember, 2 years ago, while learning HTML with DreamWeaver, we where able to send e-mail and received them in our Yahoo e-mail accounts (without any special configuration).
Thanks for helping
The web server won't make a difference. Whether you can will depend on the environment your server is in.
The simplest option is to use .NET's built-in email classes. You're probably using .NET 3.5 so that's System.Net.Mail, e.g.
MailMessage message = new MailMessage()
{
From = new MailAddress("you#youraddress", "Your Name"),
Subject = "The subject",
Body = #"Simple text body; set IsBodyHtml for HTML"
};
message.To.Add(new MailAddress("first#recipient.address", "First recipient - can add more"));
SmtpClient smtpClient = new SmtpClient("your.smtp.server");
smtpClient.Send(message);
If you don't specify an SMTP server name in the constructor it will read it from web.config.
If you don't have access to an SMTP server but do have permission to use external web services then you could use something like http://postmarkapp.com/ - I've seen other questions about them here but haven't used them myself.
Not answering straight to the question, but:
If testing the emails sent when running on a development server is the purpose, a simple SMTP stub server like smtp4dev is a good alternative?

Resources