SMTP email to different hosts

Hi,

I am trying to send an email to people in our company and also in other company once I finish a task. I am using SMTP client to send the email. But, people in the other company are not getting the emails. Can I use SMTP client to send emails to different domains(hosts)?


Dim SMTPMail As SmtpClient
 
Dim Body As String = ""
 
Dim Subject As String
 
Dim m_MailFrom = xyz@domain1.com
 
Dim m_MailRec =  123@domain1.com, 345@domain2.com, 456@domain2.com
 
 
 
SMTPMail = New SmtpClient
 
SMTPMail.Send(m_MailFrom, m_MailRec, Subject, Body)

Open in new window

LVL 1
blitzzyAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

bhnmiCommented:
what are you using for the smtp relay?
0
Matt1705Commented:
Your email server may not allow relaying outside your company.  To test this, telnet to your email server with these commands....

telnet x.x.x.x 25

helo
mail from:<ValidUser@InternalDomain>
rcpt to:<User@ExternalDomain>

If it rejects the rcpt to: command line, you can't relay outside.
0
Matt1705Commented:
You also need to do this from the computer you are sending the mail from.  Your email server may also restrict relaying to specific computers.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
blitzzyAuthor Commented:
I tested the telnet and everything worked fine.(It did not reject the recipient). I was checking again to make sure that there isnt anything that I missed. This is what I found out:
The "from" address in my code was: "noreply@domain1.com" which is like a default address. There was no such mailbox in our system with that account. We created an actual mailbox called test@domain1.com and tried to send the emails to different hosts now and It works great now.
Thanks for your help,
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.