Solved

SMTP for email routing

Posted on 2010-09-07
16
349 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
  • 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
 
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
[Webinar] Disaster Recovery and Cloud Management

Learn from Unigma and CloudBerry industry veterans which providers are best for certain use cases and how to lower cloud costs, how to grow your Managed Services practice in IaaS clouds, and how to utilize public cloud for Disaster Recovery

 

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

Don't lose your head updating email signatures!

Do your end users still have the wrong email signature? Do email signature updates bore you or fill you with a sense of dread? You can make this a whole lot easier on yourself by trusting an Exclaimer email signature management solution. Over 50 million users do...so should you!

Question has a verified solution.

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

Exchange server is not supported in any cloud-hosted platform (other than Azure with Azure Premium Storage).
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
In this video we show how to create a mailbox database 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 Servers >> Data…
This video demonstrates how to sync Microsoft Exchange Public Folders with smartphones using CodeTwo Exchange Sync and Exchange ActiveSync. To learn more about CodeTwo Exchange Sync and download the free trial, go to: http://www.codetwo.com/excha…

867 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now