Search The ForumSearch   RegisterRegister  LoginLogin

MailBee.NET SMTP

 AfterLogic Forum : MailBee.NET SMTP
Subject Topic: To restrict sending emails to Yahoo Gmail Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
reena_bharti
Newbie
Newbie


Joined: 11 November 2006
Location: United States
Online Status: Offline
Posts: 8
Posted: 22 May 2007 at 2:45pm | IP Logged Quote reena_bharti

hi

I am using Mailbee IMAP and SMTP components in an application where every user has their own personal email account.
We have a requirement of not sending emails to any external domain like yahoo, gmail etc. Is there any way that i can write in code that can restrict all users from sending emails to all external domains from application end itself.

Thanks
-- Reena
Back to Top View reena_bharti's Profile Search for other posts by reena_bharti
 
Alex
AfterLogic Support
AfterLogic Support
Avatar

Joined: 19 November 2003
Online Status: Offline
Posts: 2206
Posted: 22 May 2007 at 3:35pm | IP Logged Quote Alex

If you're sending all mails via a dedicated SMTP server, you can disable SMTP authentication when sending through this servers. Most SMTP servers are configured not to allow sending to external addresses if SMTP authentication is not enabled.

By default, SMTP authentication is disabled in both MailBee SMTP and MailBee.NET SMTP components. Thus, you should either do nothing or disable it if you enabled it before.

However, if you do not even want to connect to the server in the case of external address, you'll have to test if the address is local or not. For instance, you can iterate through mailer.Message.GetAllRecipients() collection (assuming mailer is Smtp instance) and call GetDomain for every EmailAddress returned. Then you should compare this address with the domain names you accept as local ones. If any non-local address detected, you report error to the user.

Regards,
Alex
Back to Top View Alex's Profile Search for other posts by Alex
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump

Powered by Web Wiz Forums version 7.9
Copyright ©2001-2004 Web Wiz Guide