Professional Web Applications Themes

Sending Mails - ASP.NET Building Controls

Hello everybody, I have two radio buttons in a form. I want - When any one clicks on button "A" a mail will be sent to "A" & when any one clicks on button "B" mail will be sent to button "B". In both the cases whether someone clicks on A or B I will receive a mail. Can anyone help me with the coding pls? Thanks Nilanjana...

  1. #1

    Default Sending mails

    Hello everybody,

    I have two radio buttons in a form. I want - When any one clicks on button "A"
    a mail will be sent to "A" & when any one clicks on button "B" mail will be
    sent to button "B". In both the cases whether someone clicks on A or B I will
    receive a mail. Can anyone help me with the coding pls?

    Thanks
    Nilanjana
    Nilanjana Bhattacharya Guest

  2. #2

    Default Re: Sending mails

    Nilanjana Bhattacharya wrote:
    > Hello everybody,
    >
    > I have two radio buttons in a form. I want - When any one clicks on button "A"
    > a mail will be sent to "A" & when any one clicks on button "B" mail will be
    > sent to button "B". In both the cases whether someone clicks on A or B I will
    > receive a mail. Can anyone help me with the coding pls?
    >
    > Thanks
    > Nilanjana
    never heard of any button that could recieve email, please be more
    specific, include code
    Eternius Guest

  3. #3

    Default RE: Sending mails

    Nilanjana Bhattacharya wrote:
    > Hello everybody,
    >
    > I have two radio buttons in a form. I want - When any one clicks on
    > button "A" a mail will be sent to "A" & when any one clicks on button
    > "B" mail will be sent to button "B". In both the cases whether
    > someone clicks on A or B I will receive a mail. Can anyone help me
    > with the coding pls?
    Yes, but we generally want to see what you have so far.

    Is this a web form? If so, you'll need to write a CGI program to handle the
    form. Use Perl's CGI module for this. For sending mail, I recommend the
    Mail::Send module, available from CPAN.
    Bob Showalter Guest

  4. #4

    Default Re: Sending mails

    I tried using this code but it's giving error.
    Can you explain in details pls as this is my first perl script & don't know
    much of programming.

    Thanks
    Nilanjana
    ---------------

    > On Wed, 4 Feb 2004 14:07:43 +0530, [email]nilanjanamanaskriti.com[/email] (Nilanjana
    > Bhattacharya) wrote:
    >
    > >Hello everybody,
    > >
    > >I have two radio buttons in a form. I want - When any one clicks on
    button "A"
    > >a mail will be sent to "A" & when any one clicks on button "B" mail will
    be
    > >sent to button "B". In both the cases whether someone clicks on A or B I
    will
    > >receive a mail. Can anyone help me with the coding pls?
    >
    > Well here is some untested code which will give you a start.
    >
    > #!/usr/bin/perl
    > use warnigs;
    > use strict;
    > use MIME::Lite;
    > use CGI 'param';
    >
    > # Assign variables to arguments
    > # you need your html form to send these
    > my $a = param{'button_a_address'} || undef;
    > my $b = param{'button_b_address'} || undef;
    >
    > my $me = 'meme.com';
    > my $addr;
    >
    > if(defined $a){$addr = $a}else{$addr = $b}
    >
    > my $msg = MIME::Lite->new(
    > >From =>'zz.com',
    > To =>$addr,
    > Bcc =>$me,
    > Subject =>'test message',
    > Type =>'TEXT',
    > Data =>'This is a test',
    > );
    > $msg->attach(Type =>'application/octet-stream',
    > Encoding =>'base64',
    > Path =>'test.zip',
    > );
    > $msg->send;
    >
    > # Print HTML Out
    > print "Content-type: text/html\n\n";
    > print <<"END";
    > <html>
    > <head>
    > <title>Mail Sent!!</title>
    > </head>
    > <br>
    > <center>
    > <br><br>The file has been successfully sent to
    > print $addr;
    > </center>
    > </body>
    > </html>
    > **END**
    > __END__
    >
    >
    >
    > --
    > When life conspires against you, and no longer floats your boat,
    > Don't waste your time with crying, just get on your back and float.
    >





    nilanjana@manaskriti.com Guest

  5. #5

    Default Re: Sending mails

    I'm still learning myself and haven't tried sending email's from perl scripts (yet). I did however notice one typo which might help you grab more info on what's going on.

    Check the below in your code. Change 'use warnigs' to 'use warnings'

    Hopefully it will help give you a bit more to go on.
    > #!/usr/bin/perl
    > use warnigs;
    > use strict;
    > use MIME::Lite;
    > use CGI 'param';
    > I tried using this code but it's giving error.
    > Can you explain in details pls as this is my first perl script & don't know
    > much of programming.
    >
    > Thanks
    > Nilanjana
    > ---------------
    >
    >
    > > On Wed, 4 Feb 2004 14:07:43 +0530, [email]nilanjanamanaskriti.com[/email] (Nilanjana
    > > Bhattacharya) wrote:
    > >
    > > >Hello everybody,
    > > >
    > > >I have two radio buttons in a form. I want - When any one clicks on
    > button "A"
    > > >a mail will be sent to "A" & when any one clicks on button "B" mail will
    > be
    > > >sent to button "B". In both the cases whether someone clicks on A or B I
    > will
    > > >receive a mail. Can anyone help me with the coding pls?
    > >
    > > Well here is some untested code which will give you a start.
    > >
    > > #!/usr/bin/perl
    > > use warnigs;
    > > use strict;
    > > use MIME::Lite;
    > > use CGI 'param';
    > >
    > > # Assign variables to arguments
    > > # you need your html form to send these
    > > my $a = param{'button_a_address'} || undef;
    > > my $b = param{'button_b_address'} || undef;
    > >
    > > my $me = 'meme.com';
    > > my $addr;
    > >
    > > if(defined $a){$addr = $a}else{$addr = $b}
    > >
    > > my $msg = MIME::Lite->new(
    > > >From =>'zz.com',
    > > To =>$addr,
    > > Bcc =>$me,
    > > Subject =>'test message',
    > > Type =>'TEXT',
    > > Data =>'This is a test',
    > > );
    > > $msg->attach(Type =>'application/octet-stream',
    > > Encoding =>'base64',
    > > Path =>'test.zip',
    > > );
    > > $msg->send;
    > >
    > > # Print HTML Out
    > > print "Content-type: text/html\n\n";
    > > print <<"END";
    > > <html>
    > > <head>
    > > <title>Mail Sent!!</title>
    > > </head>
    > > <br>
    > > <center>
    > > <br><br>The file has been successfully sent to
    > > print $addr;
    > > </center>
    > > </body>
    > > </html>
    > > **END**
    > > __END__
    u235sentinel@comcast.net Guest

  6. #6

    Default Re: Sending Mails

    Hi there!

    I had the same problem by sending mail through SMTP. My problem was the
    McAfee Virusscan where port 25 was blocked for outgoing requests. I just
    disabled the blockingfeature for prot 25, and it works!

    Regards,

    Wietse Kok
    The Netherlands

    *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    Wietse Kok Guest

Similar Threads

  1. Sending mails through perl
    By mugiltsr@gmail.com in forum PERL Modules
    Replies: 12
    Last Post: April 18th, 04:45 PM
  2. Sending contact form info from Flash to ASP.net forwebmail sending
    By GhostElite in forum Macromedia Flash Data Integration
    Replies: 1
    Last Post: February 1st, 02:32 PM
  3. Application not Sending mails
    By esetavia in forum Coldfusion Server Administration
    Replies: 5
    Last Post: July 27th, 11:57 AM
  4. Sending e-mails
    By jimmy_milk in forum Macromedia Dynamic HTML
    Replies: 1
    Last Post: July 19th, 09:54 PM
  5. mail() sending mails twice to the e-mails addresses at BCC
    By Maria Garcia Suarez in forum PHP Development
    Replies: 0
    Last Post: July 15th, 12:35 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139