473,508 Members | 2,460 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

sending mail with .NET

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
Jul 21 '05 #1
3 1413
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).

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

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

does anyone know how can i do this?

thanks a lot
.

Jul 21 '05 #2
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,

"Jon Paugh" <an*******@discussions.microsoft.com> wrote in message
news:09****************************@phx.gbl...
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).

-----Original Message-----
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
.

Jul 21 '05 #3
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?
-----Original Message-----
thanks Jon for your reply,
I got the email part working but the problem that i am facing is whats theidea behinde sending emails based on postal code?
i have somehow to put all postal codes into some kind of groups and thensort the email based on that group. whats the best way to do this?
thanks,

"Jon Paugh" <an*******@discussions.microsoft.com> wrote in messagenews:09****************************@phx.gbl...
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).

>-----Original Message-----
>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
>
>
>.
>

.

Jul 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
522
by: praba kar | last post by:
Dear All, I have doubt regarding mail sending smtplib module. The below code is I used to send a mail. ########################################## import email.Message import email.Utils...
10
4942
by: Stuart Mueller | last post by:
I have an exchange server, that I sometimes use to perform mail shots to clients on our database, these can be upwards of 1000 at a time. As we don't want different clients to see who we are...
2
9207
by: Mr. x | last post by:
Hello, I am sending emails with Hebrew contents. When receiving emails - I cannot see the Hebrew characters (it is not outlook express configuration, because when receiving emails from friends -...
3
6806
by: VB Programmer | last post by:
I have an ASPX page where I send out emails through my mail server mail.MyDomain.com. When I send emails to MyName@MyDomain.com it sends PERFECTLY. When I try sending an email to any other address...
3
57584
by: HoustonComputerGuy | last post by:
I am working on getting my web applications moved to .Net 2.0 and am having some problems with System.Net.Mail. I get the following error when sending the mail: System.Net.Mail.SmtpException was...
1
8154
by: Eric Sheu | last post by:
Greetings, I have been searching the web like mad for a solution to my SMTP problem. I am using Windows Server 2003 and ASP.NET 2.0 w/ C# to send out e-mails from a web site I have created to...
2
10129
by: HK | last post by:
In VB.NET, I'm getting the exception "failure sending mail". I'm running VS 2005 on XP Home. This is a new install on a new PC. I've never had email problems with VS 2003, and there I could...
3
1965
by: mfleet1973 | last post by:
Hello Again. I have a program that sends e-mails as follows: Try Dim mail As New MailMessage mail.To = "me@comp.com" mail.From = "me@comp.com mail.Subject = "Test" mail.Body = "Testing123"
9
3434
by: JoeP | last post by:
Hi All, How can I find the reason for such an error: Failure sending mail. Some Code... oMailMessage.IsBodyHtml = False oMailMessage.Body = cEmailBody Dim oSMTP As New SmtpClient...
4
2379
by: =?Utf-8?B?R3V5IENvaGVu?= | last post by:
Hi all I use: Dim message As New MailMessage(txtTo.Text, txtFrom.Text, txtSubject.Text, txtBody.Text) Dim emailClient As New SmtpClient(txtSMTPServer.Text) emailClient.Send(message) And its...
0
7114
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7321
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7377
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7488
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5623
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5045
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3191
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1544
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
762
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.