sending mail with .NET

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • hkadhim

    #1

    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


  • Jon Paugh

    #2
    sending mail with .NET

    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).

    [color=blue]
    >-----Original Message-----
    >hi all,
    >i need to know how to forward an email sent from ASP.NET[/color]
    form to a special[color=blue]
    >email account based on a Postal Code entry?
    >
    >I have 5 email accounts, and in my form i have a text box[/color]
    for Postal Code[color=blue]
    >entery. I this form to be mail to email account # 1 if[/color]
    the entery in the[color=blue]
    >postal code text box for example N6C1E3, and to go to[/color]
    email # 2 if the[color=blue]
    >entery is T5T6Y7.
    >
    >does anyone know how can i do this?
    >
    >thanks a lot
    >
    >
    >.
    >[/color]

    Comment

    • Jon Paugh

      #3
      sending mail with .NET

      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).

      [color=blue]
      >-----Original Message-----
      >hi all,
      >i need to know how to forward an email sent from ASP.NET[/color]
      form to a special[color=blue]
      >email account based on a Postal Code entry?
      >
      >I have 5 email accounts, and in my form i have a text box[/color]
      for Postal Code[color=blue]
      >entery. I this form to be mail to email account # 1 if[/color]
      the entery in the[color=blue]
      >postal code text box for example N6C1E3, and to go to[/color]
      email # 2 if the[color=blue]
      >entery is T5T6Y7.
      >
      >does anyone know how can i do this?
      >
      >thanks a lot
      >
      >
      >.
      >[/color]

      Comment

      • hkadhim

        #4
        Re: sending mail with .NET

        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" <anonymous@disc ussions.microso ft.com> wrote in message
        news:095b01c3ae 07$be966fc0$a00 1280a@phx.gbl.. .[color=blue]
        > 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).
        >
        >[color=green]
        > >-----Original Message-----
        > >hi all,
        > >i need to know how to forward an email sent from ASP.NET[/color]
        > form to a special[color=green]
        > >email account based on a Postal Code entry?
        > >
        > >I have 5 email accounts, and in my form i have a text box[/color]
        > for Postal Code[color=green]
        > >entery. I this form to be mail to email account # 1 if[/color]
        > the entery in the[color=green]
        > >postal code text box for example N6C1E3, and to go to[/color]
        > email # 2 if the[color=green]
        > >entery is T5T6Y7.
        > >
        > >does anyone know how can i do this?
        > >
        > >thanks a lot
        > >
        > >
        > >.
        > >[/color][/color]


        Comment

        • hkadhim

          #5
          Re: sending mail with .NET

          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" <anonymous@disc ussions.microso ft.com> wrote in message
          news:095b01c3ae 07$be966fc0$a00 1280a@phx.gbl.. .[color=blue]
          > 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).
          >
          >[color=green]
          > >-----Original Message-----
          > >hi all,
          > >i need to know how to forward an email sent from ASP.NET[/color]
          > form to a special[color=green]
          > >email account based on a Postal Code entry?
          > >
          > >I have 5 email accounts, and in my form i have a text box[/color]
          > for Postal Code[color=green]
          > >entery. I this form to be mail to email account # 1 if[/color]
          > the entery in the[color=green]
          > >postal code text box for example N6C1E3, and to go to[/color]
          > email # 2 if the[color=green]
          > >entery is T5T6Y7.
          > >
          > >does anyone know how can i do this?
          > >
          > >thanks a lot
          > >
          > >
          > >.
          > >[/color][/color]


          Comment

          • Jon Paugh

            #6
            Re: sending mail with .NET

            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?
            [color=blue]
            >-----Original Message-----
            >thanks Jon for your reply,
            >I got the email part working but the problem that i am[/color]
            facing is whats the[color=blue]
            >idea behinde sending emails based on postal code?
            >i have somehow to put all postal codes into some kind of[/color]
            groups and then[color=blue]
            >sort the email based on that group. whats the best way to[/color]
            do this?[color=blue]
            >
            >thanks,
            >
            >"Jon Paugh" <anonymous@disc ussions.microso ft.com> wrote[/color]
            in message[color=blue]
            >news:095b01c3a e07$be966fc0$a0 01280a@phx.gbl. ..[color=green]
            >> 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).
            >>
            >>[color=darkred]
            >> >-----Original Message-----
            >> >hi all,
            >> >i need to know how to forward an email sent from[/color][/color][/color]
            ASP.NET[color=blue][color=green]
            >> form to a special[color=darkred]
            >> >email account based on a Postal Code entry?
            >> >
            >> >I have 5 email accounts, and in my form i have a text[/color][/color][/color]
            box[color=blue][color=green]
            >> for Postal Code[color=darkred]
            >> >entery. I this form to be mail to email account # 1 if[/color]
            >> the entery in the[color=darkred]
            >> >postal code text box for example N6C1E3, and to go to[/color]
            >> email # 2 if the[color=darkred]
            >> >entery is T5T6Y7.
            >> >
            >> >does anyone know how can i do this?
            >> >
            >> >thanks a lot
            >> >
            >> >
            >> >.
            >> >[/color][/color]
            >
            >
            >.
            >[/color]

            Comment

            • Jon Paugh

              #7
              Re: sending mail with .NET

              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?
              [color=blue]
              >-----Original Message-----
              >thanks Jon for your reply,
              >I got the email part working but the problem that i am[/color]
              facing is whats the[color=blue]
              >idea behinde sending emails based on postal code?
              >i have somehow to put all postal codes into some kind of[/color]
              groups and then[color=blue]
              >sort the email based on that group. whats the best way to[/color]
              do this?[color=blue]
              >
              >thanks,
              >
              >"Jon Paugh" <anonymous@disc ussions.microso ft.com> wrote[/color]
              in message[color=blue]
              >news:095b01c3a e07$be966fc0$a0 01280a@phx.gbl. ..[color=green]
              >> 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).
              >>
              >>[color=darkred]
              >> >-----Original Message-----
              >> >hi all,
              >> >i need to know how to forward an email sent from[/color][/color][/color]
              ASP.NET[color=blue][color=green]
              >> form to a special[color=darkred]
              >> >email account based on a Postal Code entry?
              >> >
              >> >I have 5 email accounts, and in my form i have a text[/color][/color][/color]
              box[color=blue][color=green]
              >> for Postal Code[color=darkred]
              >> >entery. I this form to be mail to email account # 1 if[/color]
              >> the entery in the[color=darkred]
              >> >postal code text box for example N6C1E3, and to go to[/color]
              >> email # 2 if the[color=darkred]
              >> >entery is T5T6Y7.
              >> >
              >> >does anyone know how can i do this?
              >> >
              >> >thanks a lot
              >> >
              >> >
              >> >.
              >> >[/color][/color]
              >
              >
              >.
              >[/color]

              Comment

              Working...