• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 200
  • Last Modified:

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

0
blitzzy
Asked:
blitzzy
  • 2
1 Solution
 
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
 
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

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now