Solved

Send form to multiple e-mails

Posted on 2000-02-14
2
148 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
Comment Utility
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
Comment Utility
Thank you very much!  I'll try it and come back if I have additional questions!
Thanks again!
Engarde
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Recently I have been answering a lot of questions like this in IT forums that I frequent. The question posed is usually something along the lines of "We have software X installed and need to uninstall it for reason Y" or some other variant of the sa…
Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
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 fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

772 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

12 Experts available now in Live!

Get 1:1 Help Now