Add CR/NL to Email Body from INIREAD Variable

Get help with using AutoHotkey and its commands and hotkeys
Posts: 156
Joined: 13 Dec 2017, 09:27

Add CR/NL to Email Body from INIREAD Variable

21 Oct 2018, 10:35

I'm currently having to encode my email body within the script, and I would like to move it to an INI file, but the carriage returns and new lines for an IMAP object are a little illusive for me to grasp. I was hoping a guru or 20 here might help me out.

Current setup:

Code: Select all

CongregationalEmailGreeting="Thank you %RecipientFirstName% for requesting today's sermon. We hope it brings you and your loved ones closer to the Will of God.||This sermon's title is "%CellSermon_Title%", and it was preached by %CellPreacher1%.||May the Lord Bless and Keep you this glorious day.||Sincerely,|The Media Ministry on behalf of our Pastor|Our Church in Our Town, USA|||Opening Verses %CellPreacher1% used in this sermon:|%CellOpen_Verse%

Code: Select all

	the_Body = 
	Thank you %RecipientFirstName% for airing today's sermon. We hope it brings your listeners closer to the Will of God.

	Our Church
	; Create the actual email using the above variables
			oMail := ComObjCreate("Outlook.Application")
			NewMail := oMail.CreateItem(0)
			NameSpace := oMail.GetNamespace("MAPI")
			NewMail.SendUsingAccount := NameSpace.Accounts.Item("[email protected]")
			NewMail.Subject := subject
			FormatHTML := 2
			NewMail.BodyFormat := FormatHTML
			NewMail.Body := the_Body
			NewMail.To := EmailAddr[A_Index]
I'm attempting with this:

Code: Select all

	IniRead, CEmailGreeting, %OneDriveFolder%\AutoReaper.ini,Email,CongregationalEmailGreeting
	Transform, CEmailGreeting, Deref, % CEmailGreeting
	StringReplace, CEmailGreeting, CEmailGreeting, `%0D`%0A,|,All
	the_Body = %CEmailGreeting%
But this results in one unchanged, giant line in the body, and the pipes aren't transformed / replaced.

What am I doing wrong here?

Return to “Ask For Help”

Who is online

Users browsing this forum: Bing [Bot], CarPiotr, MathiasFrandsen, Xtra and 47 guests