Question
· May 16, 2018

Unable to send Emails to distribution list

Hi,

I'm trying to send emails to a distribution list but it doesnt work. However, When I send emails to individual emails it works fine. Is there a configuration that I need to be checking or enable?

I'm doing it within a Business Operation:

Set SendList="grouplist@email.com, eric@email.com"

f a1=1:1:$l(SendList,",") s ToAdd=$p(SendList,",",a1) d  
.Set Mailer = ##CLASS(%Net.SMTP).%New()
.Set Mailer.smtpserver = "10.xx.200.000"

.Set Msg = ##class(%Net.MailMessage).%New()
.Set Msg.From="manager@email.com
.Do Msg.To.Insert(ToAdd)
.Set Msg.Subject = "Sample Email to distribution list"
.Set MessageText=msgSTR
.Do Msg.TextData.Write(MessageText) 
.Do Mailer.Send(Msg)
.Do Mailer.%Close()
.Do Msg.%Close()
.Set Mailer="",Msg=""

I get the email on eric@email.com , but the guys in the group email dont recieve anything.Any advice would be appreciated on this.

Regards,

ED

Discussion (7)2
Log in or sign up to continue