Solved

Send form to multiple e-mails

Posted on 2000-02-14
2
149 Views
Last Modified: 2013-12-25
Good Morning,
I'm not sure how to phrase this question...so here's what I want to do...
I would like our members to be able to create a resume online, save it and be able to e-mail it to multiple e-mail addresses at one time, or, e-mail it from the job page, (button examples:  "home", "next job", send resume for this job", etc..)  
We have a cgi-bin, unix platform and I have FrontPage98 for editing but I don't have to use it.
Any help would be greatly appreciated!!
0
Comment
Question by:Engarde
2 Comments
 
LVL 16

Accepted Solution

by:
maneshr earned 200 total points
ID: 2519085
if you are using PERL, here's something you can try


#!/usr/local/bin/perl

use CGI;
$query=new CGI;

print "Content-type: text/html\n\n";

if ($query->param()){ ##  Called via the POST method
  $res=$query->param('resume');
  $eid=$query->param('eid');  ##  Get the list of Email ids
  $from=$query->param('from');  ##  Get the Email id of the sender
  $subject="Resume of XYZ";

  $card = "2142000.html"; ##  Can be any other filename too!!
  open(RES, ">/tmp/$card") || die $!;
  binmode RES;

  print RES res,"\n"; ##  Write the resume to the file

  close (RES);

  if(&send_mail($eid,$from,$subject,$res)){## Send the actual mail out
    print "Mails have been sent out!<br>\n";
  }else{
    print "Errors sending out Mails!<br>\n";
  }


}else{
  print "<HTML>
  <FORM METHOD=POST ACTION=\"".$ENV{SCRIPT_NAME}."\">
  <TEXTAREA name=resume rows=20 cols=85>
  Enter Your Resume here
  </TEXTAREA><P>
  Enter the email ids you want to send this resume to<br>
  <I>(Eg. a\@aol.com, xyz\@hotmail.com)</I><BR>
  <INPUT TYPE=TEXT NAME=eid size=87>
  <INPUT TYPE=HIDDEN NAME=from value=\"me\@here.com\">
  <P>
  <INPUT TYPE=SUBMIT VALUE=\"Send Now!!\">
  </FORM>";
}

sub send_mail(){
  ($to,$from,$subject,$message)=@_;

  $to=~ s/@/\\\@/g; ##  Escape the @ chars

  $mailprog ="/usr/sbin/sendmail";
  open(MAIL, "| $mailprog -t ");
  print MAIL "To: $eid\n";
  print MAIL "From: $from\n";
  print MAIL "Subject: $subject\n";
  print MAIL $message,"\n";

  close(MAIL);
  return 1;
}
0
 

Author Comment

by:Engarde
ID: 2530667
Thank you very much!  I'll try it and come back if I have additional questions!
Thanks again!
Engarde
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this tutorial I will aim to show you how simple is making a small application in WhizBase, how to add, remove and update data in the DB. I will make a small address book application where you can add, browse, update and remove addresses. I wi…
I hope you'll find this tutorial useful and interesting. So let's try to extend Tcl with a new package.  For anyone more deeply interested please check out the book "Practical Programming in Tcl and Tk". It's really one of the best written books abo…
Learn the basics of modules and packages in Python. Every Python file is a module, ending in the suffix: .py: Modules are a collection of functions and variables.: Packages are a collection of modules.: Module functions and variables are accessed us…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now