sending mail with .NET

  • Thread starter Thread starter hkadhim
  • Start date Start date
H

hkadhim

hi all,
i need to know how to forward an email sent from ASP.NET form to a special
email account based on a Postal Code entry?

I have 5 email accounts, and in my form i have a text box for Postal Code
entery. I this form to be mail to email account # 1 if the entery in the
postal code text box for example N6C1E3, and to go to email # 2 if the
entery is T5T6Y7.

does anyone know how can i do this?

thanks a lot
 
Setup an SMTP server.
Create MailMessage instance and set its To property as
appropriate.
Send the messages using SmtpServer class (which must be
initialized to use your SMTP Server).
 
thanks Jon for your reply,
I got the email part working but the problem that i am facing is whats the
idea behinde sending emails based on postal code?
i have somehow to put all postal codes into some kind of groups and then
sort the email based on that group. whats the best way to do this?

thanks,
 
Maybe you could create an instance of Hashtable? And then
add elements into it with
key=postal code
value=the email address
Add this hashtable to your cache, with permenant time
period.
Then use the Item property on the hashtable to get the
phone number for the postal code you want?
 
Back
Top