Last post Oct 25, 2010 06:34 AM by Edmondo
Oct 12, 2010 07:37 AM|Edmondo|LINK
My program sends emails via SMTP, it sends emails with no problem when just a normal email address ie firstname.lastname@example.org but as soon as I try to send it to a pre defined distribution list i get a bounce back message in outlook telling me I dont have permission
to send to this list.
I have put in my network credentials into the code but it doesn't seem to make a difference.
Does anyone know if there is any other reason it wont send to a distribution list? The distrbution list was created in Active Directory, it is not a list I have setup in my own outlook.
Any thoughts appreciated.
Oct 15, 2010 05:22 AM|dinakaran|LINK
Can you send me your code i ll check it.
Oct 18, 2010 03:52 AM|prateektiwari14|LINK
Please check these links. Probably this will helps you
Oct 25, 2010 06:34 AM|Edmondo|LINK
Dim Mail As New System.Net.Mail.MailMessage
Dim SmtpServer As New SmtpClient
Dim carbonCopy As String
Dim smtpUser As New System.Net.NetworkCredential
Dim html As String = ScreenScrapeHtml("http://localhost:2704/Site/EmailTemplate.aspx")
carbonCopy = loadCarbonCopy()
smtpUser.UserName = "username"
smtpUser.Password = "password"
smtpUser.Domain = "Domain"
SmtpServer.UseDefaultCredentials = False
SmtpServer.Credentials = smtpUser
SmtpServer.Port = 25
SmtpServer.Host = "exchangeServer"
SmtpServer.EnableSsl = False
Mail.From = New MailAddress("email@example.com")
Mail.Subject = ""
Mail.IsBodyHtml = True
Mail.Body = html
I have username and password in there so I am not sure why it tells me it can't send to a distribution list. It brings distribution list value from the CarbonCopy table in the database and populates the carbonCopy variable with that information.
The carbonCopy address is read in as "firstname.lastname@example.org" which is the SMTP address name for the distribution list I want to send to.