Jump to content

douza

New Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

douza's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi themistral, Thanks for that reply I have had a play around with the code and Ive managed to get a copy to a different addy. The only problem is now the from header wont work. I think I need the code below to have a ful stop after the ($headers =) so it reads ($headers .=) but that still wont work either. Also what does the line (\r\n) mean after the line like in the example you gave. $headers = "From: $from"; $headers = "CC: $cc"; Phil
  2. Does anyone know how to add a second email i.e. carbon copy (cc) into this script I have had a few attempts but failed. Thanks Code below.. --------------------------------------------------------------- <?php $dbhost = ''; $dbuser = ''; $dbpass = ''; $dbname = ''; $use_gzip = "yes"; $remove_sql_file = "yes"; $remove_gzip_file = "no"; $savepath = ""; $send_email = "yes"; $to = ""; $from = ""; $senddate = date("j F Y"); $subject = "MySQL Database Backup - $senddate"; $message = "MySQL database has been backed up and is attached to this email"; $use_ftp = "yes"; $ftp_server = ""; $ftp_user_name = ""; $ftp_user_pass = ""; $ftp_path = "/"; $date = date("mdy-hia"); $filename = "$savepath/$dbname-$date.sql"; passthru("mysqldump --opt -h$dbhost -u$dbuser -p$dbpass $dbname >$filename"); if($use_gzip=="yes"){ $zipline = "tar -czf ".$dbname."-".$date."_sql.tar.gz $dbname-$date.sql"; shell_exec($zipline); } if($remove_sql_file=="yes"){ exec("rm -r -f $filename"); } if($use_gzip=="yes"){ $filename2 = "$savepath/".$dbname."-".$date."_sql.tar.gz"; } else { $filename2 = "$savepath/$dbname-$date.sql"; } if($send_email == "yes" ){ $fileatt_type = filetype($filename2); $fileatt_name = "".$dbname."-".$date."_sql.tar.gz"; $headers = "From: $from"; $file = fopen($filename2,'rb'); $data = fread($file,filesize($filename2)); fclose($file); $semi_rand = md5(time()); $mime_boundary = "==Multipart_Boundary_x{$semi_rand}x"; $headers .= "\nMIME-Version: 1.0\n" ."Content-Type: multipart/mixed;\n" ." boundary=\"{$mime_boundary}\""; $message = "This is a multi-part message in MIME format.\n\n" ."--{$mime_boundary}\n" ."Content-Type: text/plain; charset=\"iso-8859-1\"\n" ."Content-Transfer-Encoding: 7bit\n\n" . $message . "\n\n"; $data = chunk_split(base64_encode($data)); $message .= "--{$mime_boundary}\n" ."Content-Type: {$fileatt_type};\n" ." name=\"{$fileatt_name}\"\n" ."Content-Disposition: attachment;\n" ." filename=\"{$fileatt_name}\"\n" ."Content-Transfer-Encoding: base64\n\n" . $data . "\n\n" ."--{$mime_boundary}--\n"; $ok = @mail($to, $subject, $message, $headers); if ($ok) { echo "<h4><center>Database backup created and sent! File name $filename2</center></h4>"; } else { echo "<h4><center>Mail could not be sent. Sorry!</center></h4>"; } } if($use_ftp == "yes"){ $ftpconnect = "ncftpput -u $ftp_user_name -p $ftp_user_pass -d debsender_ftplog.log -e dbsender_ftplog2.log -a -E -V $ftp_server $ftp_path $filename2"; shell_exec($ftpconnect); echo "<h4><center>$filename2 Was created and uploaded to your FTP server!</center></h4>"; } if($remove_gzip_file=="yes"){ exec("rm -r -f $filename2"); } ?> ---------------------------------------------------------------------------
  3. Hi, I have a contact form on a small webiste and have used code from various sources. But I have two small problems that I cant seem to work out. 1. Once submitted it opened a new browser unitl I added this small piece of code but Im not sure its the right thing to do to stop it. ( _root.c, ) Also nothing is coming through just a blank email I thing its something to do with the my_lv.name Please find below the code from the flash site and the pkm.php file to see if you can spot any errors [quote] #This is from the page# stop (); System.useCodePage = true; loadText = new LoadVars(); loadText.load("contents/webmail.txt"); loadText.onLoad = function () { title.htmlText = this.title; content.htmlText = this.content; }; function sendForm () { my_lv = new LoadVars (); my_lv.name = _parent.name_txt.text; my_lv.email = _parent.email_txt.text; my_lv.message = _parent.message_txt.text; my_lv.send ("http://ccgi.douza.plus.com/webmail/email.php",_root.c, "POST"); nextFrame(); } send_btn.onRelease = function () { if (name_txt == "" || email_txt == "" || message_txt == "") { status_txt = "Please complete the form"; } else { status_txt.text = ""; sendForm (); } }; [/quote] [quote] #This is from the php file# <?php $sendTo = "email@pkmironing.co.uk"; $subject = "Webmail from PKM Ironing Service"; $headers = "From: ". $_POST["my_lv.name"] . "<" . $_POST["my_lv.email"] .">\r\n"; $headers .= "Reply-To: " . $_POST["my_lv.email"] . "\r\n"; $headers .= "Return-path: " . $_POST["my_lv.email"]; $message = $_POST["my_lv.message"]; mail($sendTo, $subject, $message, $headers); ?> [/quote] _________________ Best Regards Marshy  ::) email@douza.co.uk
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.