automatic email notification of online form submission

Discussion in 'ASP .Net' started by =?Utf-8?B?aGF2ZW5vY2x1ZQ==?=, Oct 24, 2005.

  1. I have a database application that is submitted to an Access database. What
    I want is when the form is submitted to automatically send an email to
    multiple persons with the info from the form. This could be as an
    attachement or plain text. I wouldn't care if it was like the mailto. I'm
    clueless on how to do this.
    Any help would be greatly appreciated.
     
    =?Utf-8?B?aGF2ZW5vY2x1ZQ==?=, Oct 24, 2005
    #1
    1. Advertising

  2. =?Utf-8?B?aGF2ZW5vY2x1ZQ==?=

    Karl Seguin Guest

    Look at the System.Web.Mail namespace

    it's pretty easy, check out: http://www.aspheute.com/english/20000918.asp

    basically create a new MailMessage, set all the properties (To, From,
    Subject, Body) and use the Attachments.Add to point to the file to attach.

    before doing a SmtpMail.Send though, you might need to do
    SmtpMail.SmtpServer ="SMTP_SERVER_ADDRESS"

    I think by default it looks for an smtp server on the same machine as your
    web site, which is probably what you want.

    Karl

    --
    MY ASP.Net tutorials
    http://www.openmymind.net/
    "havenoclue" <> wrote in message
    news:...
    >I have a database application that is submitted to an Access database.
    >What
    > I want is when the form is submitted to automatically send an email to
    > multiple persons with the info from the form. This could be as an
    > attachement or plain text. I wouldn't care if it was like the mailto.
    > I'm
    > clueless on how to do this.
    > Any help would be greatly appreciated.
     
    Karl Seguin, Oct 24, 2005
    #2
    1. Advertising

  3. Thanks for your quick response karl.
    Forgive me but I'm new to this stuff. I've looked at this before and didn't
    really know how to implement this code. Is this from the CodeBehind or the
    html
    output?

    "Karl Seguin" wrote:

    > Look at the System.Web.Mail namespace
    >
    > it's pretty easy, check out: http://www.aspheute.com/english/20000918.asp
    >
    > basically create a new MailMessage, set all the properties (To, From,
    > Subject, Body) and use the Attachments.Add to point to the file to attach.
    >
    > before doing a SmtpMail.Send though, you might need to do
    > SmtpMail.SmtpServer ="SMTP_SERVER_ADDRESS"
    >
    > I think by default it looks for an smtp server on the same machine as your
    > web site, which is probably what you want.
    >
    > Karl
    >
    > --
    > MY ASP.Net tutorials
    > http://www.openmymind.net/
    > "havenoclue" <> wrote in message
    > news:...
    > >I have a database application that is submitted to an Access database.
    > >What
    > > I want is when the form is submitted to automatically send an email to
    > > multiple persons with the info from the form. This could be as an
    > > attachement or plain text. I wouldn't care if it was like the mailto.
    > > I'm
    > > clueless on how to do this.
    > > Any help would be greatly appreciated.

    >
    >
    >
     
    =?Utf-8?B?aGF2ZW5vY2x1ZQ==?=, Oct 24, 2005
    #3
  4. that sample is in the HTML view, but you can easily do this from the
    codebehind in the button click event

    --
    Curt Christianson
    site: http://www.darkfalz.com
    blog: http://blog.darkfalz.com



    "havenoclue" wrote:

    > Thanks for your quick response karl.
    > Forgive me but I'm new to this stuff. I've looked at this before and didn't
    > really know how to implement this code. Is this from the CodeBehind or the
    > html
    > output?
    >
    > "Karl Seguin" wrote:
    >
    > > Look at the System.Web.Mail namespace
    > >
    > > it's pretty easy, check out: http://www.aspheute.com/english/20000918.asp
    > >
    > > basically create a new MailMessage, set all the properties (To, From,
    > > Subject, Body) and use the Attachments.Add to point to the file to attach.
    > >
    > > before doing a SmtpMail.Send though, you might need to do
    > > SmtpMail.SmtpServer ="SMTP_SERVER_ADDRESS"
    > >
    > > I think by default it looks for an smtp server on the same machine as your
    > > web site, which is probably what you want.
    > >
    > > Karl
    > >
    > > --
    > > MY ASP.Net tutorials
    > > http://www.openmymind.net/
    > > "havenoclue" <> wrote in message
    > > news:...
    > > >I have a database application that is submitted to an Access database.
    > > >What
    > > > I want is when the form is submitted to automatically send an email to
    > > > multiple persons with the info from the form. This could be as an
    > > > attachement or plain text. I wouldn't care if it was like the mailto.
    > > > I'm
    > > > clueless on how to do this.
    > > > Any help would be greatly appreciated.

    > >
    > >
    > >
     
    =?Utf-8?B?Q3VydF9DIFtNVlBd?=, Oct 24, 2005
    #4
  5. I tried the code behind and got
    COMException (0x80040213): The transport failed to connect to the server

    Dim email As New System.Web.Mail.MailMessage
    email.To = " "
    email.From = " "
    email.Body = " "
    email.Subject = " "
    email.BodyFormat = Web.Mail.MailFormat.Text
    System.Web.Mail.SmtpMail.SmtpServer = "SmtpServerName"
    System.Web.Mail.SmtpMail.Send(email)

    When I use my own server domain it gives me
    550 5.7.1 Unable to relay for " "



    "Curt_C [MVP]" wrote:


    > that sample is in the HTML view, but you can easily do this from the
    > codebehind in the button click event
    >
    > --
    > Curt Christianson
    > site: http://www.darkfalz.com
    > blog: http://blog.darkfalz.com
    >
    >
    >
    > "havenoclue" wrote:
    >
    > > Thanks for your quick response karl.
    > > Forgive me but I'm new to this stuff. I've looked at this before and didn't
    > > really know how to implement this code. Is this from the CodeBehind or the
    > > html
    > > output?
    > >
    > > "Karl Seguin" wrote:
    > >
    > > > Look at the System.Web.Mail namespace
    > > >
    > > > it's pretty easy, check out: http://www.aspheute.com/english/20000918.asp
    > > >
    > > > basically create a new MailMessage, set all the properties (To, From,
    > > > Subject, Body) and use the Attachments.Add to point to the file to attach.
    > > >
    > > > before doing a SmtpMail.Send though, you might need to do
    > > > SmtpMail.SmtpServer ="SMTP_SERVER_ADDRESS"
    > > >
    > > > I think by default it looks for an smtp server on the same machine as your
    > > > web site, which is probably what you want.
    > > >
    > > > Karl
    > > >
    > > > --
    > > > MY ASP.Net tutorials
    > > > http://www.openmymind.net/
    > > > "havenoclue" <> wrote in message
    > > > news:...
    > > > >I have a database application that is submitted to an Access database.
    > > > >What
    > > > > I want is when the form is submitted to automatically send an email to
    > > > > multiple persons with the info from the form. This could be as an
    > > > > attachement or plain text. I wouldn't care if it was like the mailto.
    > > > > I'm
    > > > > clueless on how to do this.
    > > > > Any help would be greatly appreciated.
    > > >
    > > >
    > > >
     
    =?Utf-8?B?aGF2ZW5vY2x1ZQ==?=, Oct 24, 2005
    #5
  6. =?Utf-8?B?aGF2ZW5vY2x1ZQ==?=

    Karl Seguin Guest

    Where is your smtp serve rrunning?

    As I said in my original post, you'll likely have to specify the address of
    the SMTP server via SmtpMail.SmtpServer

    IIS has an smtp server built-in, perhaps you need to start the service?
    (simple mail transfer protocol I believe it's called), and point your
    SmtpServer to 127.0.0.1 (local)

    karl

    --
    MY ASP.Net tutorials
    http://www.openmymind.net/
    "havenoclue" <> wrote in message
    news:...
    >I tried the code behind and got
    > COMException (0x80040213): The transport failed to connect to the server
    >
    > Dim email As New System.Web.Mail.MailMessage
    > email.To = " "
    > email.From = " "
    > email.Body = " "
    > email.Subject = " "
    > email.BodyFormat = Web.Mail.MailFormat.Text
    > System.Web.Mail.SmtpMail.SmtpServer = "SmtpServerName"
    > System.Web.Mail.SmtpMail.Send(email)
    >
    > When I use my own server domain it gives me
    > 550 5.7.1 Unable to relay for " "
    >
    >
    >
    > "Curt_C [MVP]" wrote:
    >
    >
    >> that sample is in the HTML view, but you can easily do this from the
    >> codebehind in the button click event
    >>
    >> --
    >> Curt Christianson
    >> site: http://www.darkfalz.com
    >> blog: http://blog.darkfalz.com
    >>
    >>
    >>
    >> "havenoclue" wrote:
    >>
    >> > Thanks for your quick response karl.
    >> > Forgive me but I'm new to this stuff. I've looked at this before and
    >> > didn't
    >> > really know how to implement this code. Is this from the CodeBehind or
    >> > the
    >> > html
    >> > output?
    >> >
    >> > "Karl Seguin" wrote:
    >> >
    >> > > Look at the System.Web.Mail namespace
    >> > >
    >> > > it's pretty easy, check out:
    >> > > http://www.aspheute.com/english/20000918.asp
    >> > >
    >> > > basically create a new MailMessage, set all the properties (To, From,
    >> > > Subject, Body) and use the Attachments.Add to point to the file to
    >> > > attach.
    >> > >
    >> > > before doing a SmtpMail.Send though, you might need to do
    >> > > SmtpMail.SmtpServer ="SMTP_SERVER_ADDRESS"
    >> > >
    >> > > I think by default it looks for an smtp server on the same machine as
    >> > > your
    >> > > web site, which is probably what you want.
    >> > >
    >> > > Karl
    >> > >
    >> > > --
    >> > > MY ASP.Net tutorials
    >> > > http://www.openmymind.net/
    >> > > "havenoclue" <> wrote in message
    >> > > news:...
    >> > > >I have a database application that is submitted to an Access
    >> > > >database.
    >> > > >What
    >> > > > I want is when the form is submitted to automatically send an email
    >> > > > to
    >> > > > multiple persons with the info from the form. This could be as an
    >> > > > attachement or plain text. I wouldn't care if it was like the
    >> > > > mailto.
    >> > > > I'm
    >> > > > clueless on how to do this.
    >> > > > Any help would be greatly appreciated.
    >> > >
    >> > >
    >> > >
     
    Karl Seguin, Oct 24, 2005
    #6
  7. Thanks Karl and Curt

    I have it now. Just have more problems.

    "Karl Seguin" wrote:

    > Where is your smtp serve rrunning?
    >
    > As I said in my original post, you'll likely have to specify the address of
    > the SMTP server via SmtpMail.SmtpServer
    >
    > IIS has an smtp server built-in, perhaps you need to start the service?
    > (simple mail transfer protocol I believe it's called), and point your
    > SmtpServer to 127.0.0.1 (local)
    >
    > karl
    >
    > --
    > MY ASP.Net tutorials
    > http://www.openmymind.net/
    > "havenoclue" <> wrote in message
    > news:...
    > >I tried the code behind and got
    > > COMException (0x80040213): The transport failed to connect to the server
    > >
    > > Dim email As New System.Web.Mail.MailMessage
    > > email.To = " "
    > > email.From = " "
    > > email.Body = " "
    > > email.Subject = " "
    > > email.BodyFormat = Web.Mail.MailFormat.Text
    > > System.Web.Mail.SmtpMail.SmtpServer = "SmtpServerName"
    > > System.Web.Mail.SmtpMail.Send(email)
    > >
    > > When I use my own server domain it gives me
    > > 550 5.7.1 Unable to relay for " "
    > >
    > >
    > >
    > > "Curt_C [MVP]" wrote:
    > >
    > >
    > >> that sample is in the HTML view, but you can easily do this from the
    > >> codebehind in the button click event
    > >>
    > >> --
    > >> Curt Christianson
    > >> site: http://www.darkfalz.com
    > >> blog: http://blog.darkfalz.com
    > >>
    > >>
    > >>
    > >> "havenoclue" wrote:
    > >>
    > >> > Thanks for your quick response karl.
    > >> > Forgive me but I'm new to this stuff. I've looked at this before and
    > >> > didn't
    > >> > really know how to implement this code. Is this from the CodeBehind or
    > >> > the
    > >> > html
    > >> > output?
    > >> >
    > >> > "Karl Seguin" wrote:
    > >> >
    > >> > > Look at the System.Web.Mail namespace
    > >> > >
    > >> > > it's pretty easy, check out:
    > >> > > http://www.aspheute.com/english/20000918.asp
    > >> > >
    > >> > > basically create a new MailMessage, set all the properties (To, From,
    > >> > > Subject, Body) and use the Attachments.Add to point to the file to
    > >> > > attach.
    > >> > >
    > >> > > before doing a SmtpMail.Send though, you might need to do
    > >> > > SmtpMail.SmtpServer ="SMTP_SERVER_ADDRESS"
    > >> > >
    > >> > > I think by default it looks for an smtp server on the same machine as
    > >> > > your
    > >> > > web site, which is probably what you want.
    > >> > >
    > >> > > Karl
    > >> > >
    > >> > > --
    > >> > > MY ASP.Net tutorials
    > >> > > http://www.openmymind.net/
    > >> > > "havenoclue" <> wrote in message
    > >> > > news:...
    > >> > > >I have a database application that is submitted to an Access
    > >> > > >database.
    > >> > > >What
    > >> > > > I want is when the form is submitted to automatically send an email
    > >> > > > to
    > >> > > > multiple persons with the info from the form. This could be as an
    > >> > > > attachement or plain text. I wouldn't care if it was like the
    > >> > > > mailto.
    > >> > > > I'm
    > >> > > > clueless on how to do this.
    > >> > > > Any help would be greatly appreciated.
    > >> > >
    > >> > >
    > >> > >

    >
    >
    >
     
    =?Utf-8?B?aGF2ZW5vY2x1ZQ==?=, Oct 24, 2005
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. BernieH

    Automatic form submission

    BernieH, Oct 7, 2004, in forum: HTML
    Replies:
    3
    Views:
    19,602
    Jan Faerber
    Oct 7, 2004
  2. Homer
    Replies:
    1
    Views:
    417
  3. sam
    Replies:
    6
    Views:
    193
  4. Replies:
    2
    Views:
    124
    Rick Scott
    Feb 26, 2006
  5. Piotr Kurpiel

    automatic form submission

    Piotr Kurpiel, Mar 18, 2005, in forum: Javascript
    Replies:
    1
    Views:
    137
    Erwin Moller
    Mar 18, 2005
Loading...

Share This Page