Solved

Send form to multiple e-mails

Posted on 2000-02-14
2
151 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

The following is a collection of cases for strange behaviour when using advanced techniques in DOS batch files. You should have some basic experience in batch "programming", as I'm assuming some knowledge and not further explain the basics. For some…
Ever wondered how to display how many visitors you have online. In this tutorial I will show you an easy but effective way to display the number of online visitors in WhizBase. In this article I assume you have read my previous articles and know …
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…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

828 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