Forums

PHP

This topic is locked

smartmailer.php

Posted 17 May 2005 15:33:42
1
has voted
17 May 2005 15:33:42 mal blackshaw posted:
I've set up a form with this to send A document now i'm a bit thick with php
and making forms i i had ago with smartmailer_php I want to be able on depending what the choose on a seperate page
it pulls the Id of that information and inserts the subject not only that it pulls the email address from the sql table to send this information to
So i created a simple table in mysql
id
name
email <--- this is the address it needs to go to
subject <-- goes into the subject field

I went thru your very basic tuts on this extention I worked the UI to send the email address dynamically and also the Subject field dynamically the created the code. Moved the ScriptLibrary into the same folder changed the req once part to point to the file and got the following errors when submitted the form on my site?
Warning: fopen(file): failed to open stream: No such file or directory in public_html/test_email_send/ScriptLibrary/htmlMimeMail.php on line 162 Warning: Cannot modify header information - headers already sent by (output started at public_html/test_email_send/ScriptLibrary/htmlMimeMail.php:162) in public_html/test_email_send/index.php on line 48
this is the code the UI created then i made a small form with upload file in it.
#require_once('test_email.php'); //mysql connection
require_once('ScriptLibrary/incSmartMailer.php');
mysql_select_db($database_test_email, $test_email);
$query_Recordset1 = "SELECT * FROM posts";
$Recordset1 = mysql_query($query_Recordset1, $test_email) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);#
#if (count($HTTP_POST_VARS) > 0) {
@set_time_limit(300);
$sm1 = new SmartMailer();
$sm1->checkVersion("1.01";
$sm1->smtpSetup("", "", "", "";
$sm1->component = "Sendmail";
$sm1->tmpFolder = "uploaded";
$sm1->embedImages = false;
$sm1->progressBar = "blue_mailprogress.htm";
$sm1->ignore_errors = true;
$sm1->setFrom("", "";
$sm1->setTo($row_Recordset1['name'], $row_Recordset1['email']);
$sm1->setCc("", "";
$sm1->setBcc("", "";
$sm1->setSubject("".$row_Recordset1['subject']."";
// using static for body
$sm1->setBody_Static_html("";
// Attachments from list
$sm1->setAttList("file";
$sm1->sendMail("one";
$GoTo = "index.php";
if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) {
$GoTo .= (strpos($GoTo, '?')) ? "&" : "?";
$GoTo .= $HTTP_SERVER_VARS['QUERY_STRING'];
}
header(sprintf("Location: %s", $GoTo));
}
$SM_mailAction = getMailAction();
script language="JavaScript" //removed
function showMailProgressWindow(progressFile,popWidth,popHeight) { //v1.00
if (document.MM_returnValue!=false) {
var w = 480, h = 340;
if (document.all || document.layers || document.getElementById) {
w = screen.availWidth; h = screen.availHeight;}
var leftPos = (w-popWidth)/2, topPos = (h-popHeight)/2;
document.progressWindow = window.open(progressFile,'ProgressWindow','toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width=' + popWidth + ',height='+popHeight);
document.progressWindow.moveTo(leftPos, topPos);document.progressWindow.focus();
window.onunload = function () {document.progressWindow.close();};
} }
form action="<?php echo $SM_mailAction?>" method="post" name="form1" id="form1" onsubmit="showMailProgressWindow('blue_mailprogress.htm?<?php echo session_id()?>',300,100)"
input type="text" name="name_your" input type="text" name="email_addess"
input type="text" name="subject" value=" echo $subject; "
input type="file" name="textfield" input type="submit" name="Submit" value="Submit"
mysql_free_result($Recordset1);
any sugestions?

Reply to this topic