Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

SMTP for email routing

Posted on 2010-09-07
16
Medium Priority
?
362 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
NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

 
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 2000 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

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

This article will help to fix the below error for MS Exchange server 2010 I. Out Of office not working II. Certificate error "name on the security certificate is invalid or does not match the name of the site" III. Make Internal URLs and External…
If something goes wrong with Exchange, your IT resources are in trouble.All Exchange server migration processes are not designed to be identical and though migrating email from on-premises Exchange mailbox to Cloud’s Office 365 is relatively simple…
In this video we show how to create an Accepted Domain 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 >> Ac…
To show how to create a transport rule 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 >> Rules tab.:  To cr…

604 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