Jeffrey this works!

I will be making variations on this as we have 49 unique locations to populate automatically in the body of the email message.  However, my test went through.  To come full circle, if anyone else is looking for something like this... We are sending out "How are we doing surveys" after a clinical appointment with our Hospital and outpatient services. Based on a patient email, and the location in which they were seen, they will receive the survey (embedded in a URL).

Thanks!

When I am looking at the example

ClassMethod CreateTextMessage() As %Net.MailMessage
{
Set msg = ##class(%Net.MailMessage).%New()
set msg.From = "test@test.com"
Do msg.To.Insert("xxx@xxx.com")
Do msg.Cc.Insert("yyy@yyy.com")
Do msg.Bcc.Insert("zzz@zzz.com")
Set msg.Subject="subject line here"
Set msg.IsBinary=0
Set msg.IsHTML=0
Do msg.TextData.Write("This is the message.")

Quit msg
}

My biggest hurdle is finding a way for the message to insert PID-13-4 (email address) into the "Do msg.To.Insert___"

Anyone have any thoughts?

When I am looking at the example

ClassMethod CreateTextMessage() As %Net.MailMessage
{
Set msg = ##class(%Net.MailMessage).%New()
set msg.From = "test@test.com"
Do msg.To.Insert("xxx@xxx.com")
Do msg.Cc.Insert("yyy@yyy.com")
Do msg.Bcc.Insert("zzz@zzz.com")
Set msg.Subject="subject line here"
Set msg.IsBinary=0
Set msg.IsHTML=0
Do msg.TextData.Write("This is the message.")

Quit msg
}

My biggest hurdle is finding a way for the message to insert PID-13-4 (email address) into the "Do msg.To.Insert___"

Anyone have any thoughts?