ASP Code
  Home arrow ASP Code arrow Page 3 - Inbox and Outbox Manipulation in ASP
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Mobile Linux 
App Generation ROI 
Windows Web Hosting
 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
ASP CODE

Inbox and Outbox Manipulation in ASP
By: Burhan Khan
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 191
    2005-02-22

    Table of Contents:
  • Inbox and Outbox Manipulation in ASP
  • CDO is not everything
  • Receiving Email: Inbox
  • Inbox using CDO

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Inbox and Outbox Manipulation in ASP - Receiving Email: Inbox


    (Page 3 of 4 )

    One of the most commonly asked questions on any ASP related forum is “How can I receive email thought CDONTS?” The simple answer is “You can use CDONTS.Session to receive email in your machine.” The SMTP (Simple Mail Transfer Protocol) Service handles standard SMTP messages, which are just text files that are transmitted between hosts using the SMTP. So, in theory, we can create, modify and read SMTP mail messages just as we would any other text file.

    Inbox in Machine:

    The first thing you need to do is to make sure that you have installed Microsoft's SMTP service, which you will find as part of the Windows NT 4 Option Pack. When you have completed the Option Pack installation you will find that, within your inetpub directory (along with WINNT directory), there will be a subdirectory called mailroot. Within this mailroot directory are various other subdirectories used for processing incoming and outgoing SMTP email. Pickup and Queue are used for the sending process, and Badmail is where anything that gets bounced by the remote server will end up, while Drop is where any incoming emails will appear.

    The next thing that you need to do is to announce to the great wide world that this server in now accepting SMTP emails. For this purpose you have to associate it with a domain name. You can do this by adding records within your DNS system. One record is a MX record (MX means Mail Exchange). MX record tells other servers where to send your incoming SMTP emails. The sequence will be:

    • First, MX keyword, which tells that it is Mail Exchange record.
    • Second, Priority, it can be any integer number. Priority is useful in this sense that if your server went down, and main while emails come to your server, emails will be lost. So you can set some other servers and assign priorities to each. If height priority server is down, then server of next lower priority will be used for backup emails.
    • Finally, Server, which will accept SMTP mails. Like mail.mydomain.com

     

    For example: if your domain name is mydomain.com, the MX record will be:

    MX 10 mail.mydomain.com

    MX 20 mail.mydomain2.com

    The next thing you need to do is set up the domain name in Default SMTP sites. To do this, open IIS, in the Default SMTP sits, Right-Click on Domains, and select New -> Domain. Then choose Local, and type your domain name. That is all that is required to set up your IIS configurations.

    Now you can try to see whether it is working. For this purpose send an email to your domain, say me@mydomain.com. Now as I already said, all emails will come into the Drop directory of mailroot directory. So check the Drop directory; you will find new email with the extension  EML. The file name will be any random number + .eml extension. You can double click on that file and see your received email. This email will be open in your default mail express. You can open it in Notepad and see the original message with all headers and source code.

    We can also read messages by opening them as text files with the FileSystemObject. This may be useful for specific tasks where we are building applications that use email messages in the background to transfer information or send commands, without the messages being visible to the user in the normal way. By opening email file in this way you will also see some headers included in email. Such as:

    Received: from 202.147.176.60 by by1fd.bay1.hotmail.msn.com with HTTP;

              Thu, 22 Jan 2005 11:31:33 GMT

    X-Originating-IP: [202.147.176.60]

    X-Originating-Email: [abc@hotmail.com]

    X-Sender: abc@hotmail.com

    From: "My Name” abc@hotmail.com

    You can code to filter these headers and show the original message to the user. And you can use any application for this purpose such as VB, C++ etc…

    More ASP Code Articles
    More By Burhan Khan


       · Why are you talking about the NT4 update?Sheezeesss... who's still running that...
       · 2000 and XP are also NT bassed OS.By NT4 means, 2000 or XP (Service pack 4...
       · Saying "NT4" is *NOT* the same as saying "Windows 2000 with service pack...
       · hi this is thoma, just a month before i started my career in ASP. here i...
       · So why don't you contribute instead of berating someone else who has taken the time...
     

    ASP CODE ARTICLES

    - ASP Forms
    - ASP: The Beginning
    - Getting Remote Files With ASP Continued
    - Inbox and Outbox Manipulation in ASP
    - Relational DropDownList Using VB.NET
    - Ad Tracking URL Hits
    - Use ViewState to display one record per page...
    - Send Email using ASP.NET formatted in HTML
    - ASP File Explorer
    - ASP/XML Interview questions by Srivatsan Sri...
    - Various methods of setting Date values to a ...
    - Conditional DataGrid Item and using checkbox...
    - Fill .NET Listbox with SQL DataReader
    - Filling Dropdown box using Code-Behinds in C#
    - FLAMES code sample written in .NET What is F...





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
    Stay green...Green IT