Solved

SMTP for email routing

Posted on 2010-09-07
16
352 Views
Last Modified: 2012-05-10
Good day

We want to setup Microsoft exchange (windows 2003 server) to be able to accept SMTP email from an ASP page on another server and the server must then route the email to the correct recipient.

For example with CDO.Message, we want to do the following:

  sendUrl="http://schemas.microsoft.com/cdo/configuration/sendusing"
  smtpUrl="http://schemas.microsoft.com/cdo/configuration/smtpserver"
  AuthURL="http://schemas.microsoft.com/cdo/configuration/smtpauthenticate"
  UserURL="http://schemas.microsoft.com/cdo/configuration/sendusername"
  PassURL="http://schemas.microsoft.com/cdo/configuration/sendpassword"

  ' Set the mail server configuration
  Set objConfig=Server.CreateObject("CDO.Configuration")
  objConfig.Fields.Item(sendUrl)=2 ' cdoSendUsingPort
  objConfig.Fields.Item(smtpUrl)="mail.mydomain.com"
  
  objConfig.Fields.Item(AuthURL)=1
  objConfig.Fields.Item(UserURL)="postmaster@mydomain.com"
  objConfig.Fields.Item(PassURL)="mypassword"
  
  objConfig.Fields.Update

  Set CMail = Server.CreateObject("CDO.Message")
  Set CMail.Configuration=objConfig  
  CMail.From = sFrom
  CMail.To = sTo
  CMail.Subject = sSubject
  CMail.TextBody = sBody
  CMail.Send
  Set CMail = Nothing

Open in new window



We managed to start the SMTP service on the server, to test it we use Microsoft Mail to send email to the server, and that is working, but it does not route it to the recipient's address.
So in other words, when we sent the email it shows it was sent, but we do not receive it.
0
Comment
Question by:koossa
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 8
  • 7
16 Comments
 
LVL 6

Expert Comment

by:apresence
ID: 33615920
This really depends on your Exchange version, which you have not specified.

I have Exchange 2003 running on Server 2003.  If you've the same configuration, here's what  you need to do.  On the Exchange server:
- Open Exchange System Manager
- Browse to Servers / (your server name) / Protocols / SMTP / Default SMTP Virtual Server
- Right-click and select Properties
- Click on the Access tab
- Click on the Relay button
- Click Add, Single Computer, Enter the IP address of the system where your e-mails will be originating, then click OK to close the 'Computer' dialog
- Click OK to close the 'Relay Restrictions' dialog
- Click OK to close the 'Default SMTP Virtual Servers' dialog
- Close the Exchange System Manager

Now, try sending your e-mails again, and it should work...
0
 
LVL 8

Expert Comment

by:Mkris9
ID: 33615926
Since what you basically what is your exchange server to relay emails from the 2'nd server, have you set up relay on your exchange server ?

Pls check section (2) of http://www.servolutions.com/support/config_exchange_2003.htm
0
 

Author Comment

by:koossa
ID: 33615952

Yes, we have done exactly that, but still don't get the emails?
We are using Windows server 2003.

We can see the emails in C:\Program Files\Exchsrvr\Mailroot\vsi 1\Queue, but we don't receive it.
0
Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

 
LVL 8

Expert Comment

by:Mkris9
ID: 33615964
are you able to see the messages in your exchange server queue ?

also is the 'from address' on the emails exactly same as that of the domains set up on your exchange server ?
0
 

Author Comment

by:koossa
ID: 33616055
Yes, I can see them in the queue
At this stage the from email address is exactly the same, but when implementing it on ASP, we want the from to be different email addresses.
0
 
LVL 8

Expert Comment

by:Mkris9
ID: 33616075
What are you using to route oubound emails in your SMTP connector ? Route through DNS or another SMTP server ?
0
 

Author Comment

by:koossa
ID: 33616092
We're using route through DNS
0
 
LVL 8

Expert Comment

by:Mkris9
ID: 33616099
The To address on these emails - are they external email addresses or internal test ones ?
0
 

Author Comment

by:koossa
ID: 33616106
The To addresses are all external ones.
0
 
LVL 8

Expert Comment

by:Mkris9
ID: 33616151
Weird.... Please check message tracking logs and see if it actually says "Message Routed and Queued for Remote Delivery"

Have to tried restarting SMTP service as well as DNS service ?
if it does'nt work, what happens if you try and create an SMTP connector for the emails coming from this email address and route it through your ISP's smtp server ?
0
 
LVL 8

Expert Comment

by:Mkris9
ID: 33616193
one another question - is the from address "postmaster@mydomain.com" ?
0
 

Author Comment

by:koossa
ID: 33616249
no, that's just an example, we have created a user for @mydomain.com
0
 
LVL 8

Expert Comment

by:Mkris9
ID: 33616262
Hmm.. Let me know once you've tried the stuffs in my comment above.
0
 

Author Comment

by:koossa
ID: 33616366
We've restarted the DNS and SMTP services in computer management > administrative tools >services. Still the same problem. The funny thing is that we've used this server previously as a web server, and then the web emails went out with the above code (but without the username and password settings). Some of the old pages are still on the server and now that we've created a user to work with the SMTP service, the old pages emails are also staying in the queue.
0
 

Author Comment

by:koossa
ID: 33616864
I have stopped and started the SMTP virtual server under SMTP in the Exchange system manager and most messages went out. When I send new messages to the queue they again do not go out. When I click on the messages in the queue, I get the following Additional queue information "The connection was dropped due to an SMTP protocol event sink."
0
 
LVL 8

Accepted Solution

by:
Mkris9 earned 500 total points
ID: 33617311
ahhhh, smtp virtual server.. can't believe how I missed that... anyways, in regards to the virtual server info, http://www.experts-exchange.com/Networking/Email_Groupware/Exchange_Server/Q_21110083.html
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Migrating existing OnPremise AD and some servers to Azure ? 13 83
exchange 2007, certificates 4 31
exchange 13 24
Removing Exchange 2003 3 17
Following basic email etiquette rules will help you write a professional email and achieve a good, lasting impression with your contacts.
In-place Upgrading Dirsync to Azure AD Connect
In this video we show how to create an email address policy in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.:  First we need to log into the Exchange Admin Center. Navigate to the Mail Flow…
The basic steps you have just learned will be implemented in this video. The basic steps are shown to configure an Exchange DAG in a live working Exchange Server Environment and manage the same (Exchange Server 2010 Software is used in a Windows Ser…

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question