Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
PHP Mail Function to send html mail and attachments using Php Form Wizard
Old 08-22-2009, 10:23 PM PHP Mail Function to send html mail and attachments using Php Form Wizard
Junior Talker

Posts: 1
Name: Tunde A
Trades: 0
I generate my feedback scripts using Php Form Wizard which i recently purchased. I have however ran into a fix with a form i need to use an auto responder with that will not only send html email but will also attach a logo to send with the mail

The generated code for the feedback and auto response is as follows

<?php


// Receiving variables
@$pfw_ip= $_SERVER['REMOTE_ADDR'];
@$VTIGROUP = addslashes($_POST['VTI-GROUP']);
@$T1 = addslashes($_POST['T1']);
@$T2 = addslashes($_POST['T2']);
@$T3 = addslashes($_POST['T3']);
@$T4 = addslashes($_POST['T4']);
@$T5 = addslashes($_POST['T5']);
@$T6 = addslashes($_POST['T6']);
@$T7 = addslashes($_POST['T7']);
@$T8 = addslashes($_POST['T8']);
@$T9 = addslashes($_POST['T9']);
@$T10 = addslashes($_POST['T10']);
@$D1 = addslashes($_POST['D1']);
@$T11 = addslashes($_POST['T11']);
@$T12 = addslashes($_POST['T12']);
@$S1 = addslashes($_POST['S1']);

// Validation
if (! ereg('[A-Za-z0-9_-]+\@[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+', $T7))
{
header("Location: error.html");
exit;
}

//Sending Email to form owner
$pfw_header = "From: $T7\n"
. "Reply-To: $T7\n";
$pfw_subject = "Feedback Form from IGODYE's website";
$pfw_email_to = "infoseptemberatts@yahoo.com";
$pfw_message = "Visitor's IP: $pfw_ip\n"
. "VTIGROUP: $VTIGROUP\n"
. "T1: $T1\n"
. "T2: $T2\n"
. "T3: $T3\n"
. "T4: $T4\n"
. "T5: $T5\n"
. "T6: $T6\n"
. "T7: $T7\n"
. "T8: $T8\n"
. "T9: $T9\n"
. "T10: $T10\n"
. "D1: $D1\n"
. "T11: $T11\n"
. "T12: $T12\n"
. "S1: $S1\n";
@mail($pfw_email_to, $pfw_subject ,$pfw_message ,$pfw_header ) ;

//Sending auto respond Email to visitor
$pfw_header = "From: info@\n"
. "Reply-To: info@\n";
$pfw_subject = " Your Booking Request has been Recieved";
$pfw_email_to = "$T7";
$pfw_message = "Dear $T1,\n"
. "We have recieved your request for the booking of $D1. A Customer care representative will be looking into your request and will be getting across to you shortly with further information/instructions.\n"
. "Thank you for using US.\n"
. "HAI";
@mail($pfw_email_to, $pfw_subject ,$pfw_message ,$pfw_header ) ;

header("Location: thankyou.html");

?>


Help will be appreciated please...
Thank you
ayomitundea is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 08-23-2009, 05:26 AM Re: PHP Mail Function to send html mail and attachments using Php Form Wizard
lizciz's Avatar
Webmaster Talker

Posts: 744
Name: Mattias Nordahl
Location: Sweden
Trades: 0
There are plenty of examples and tutorials around of how to send attachments with your email. Here's just a few of them (I havn't really checked them out myself), you can find more using Google.

http://www.texelate.co.uk/blog/send-...ment-with-php/

http://www.webcheatsheet.com/PHP/sen...php#attachment
__________________
34343639363436653237373432303635373837303635363337 34323037343638363137343263323036343639363432303739 366637353366
lizciz is online now
Reply With Quote
View Public Profile Visit lizciz's homepage!
 
Old 08-25-2009, 01:56 PM Re: PHP Mail Function to send html mail and attachments using Php Form Wizard
prasanthmj's Avatar
Experienced Talker

Posts: 42
Name: Prasanth
Trades: 0
This tutorial might help:
PHP based email form with file attachment
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
prasanthmj is offline
Reply With Quote
View Public Profile
 
Old 06-01-2010, 01:56 PM Re: PHP Mail Function to send html mail and attachments using Php Form Wizard
Junior Talker

Posts: 1
Name: Tomás
Trades: 0
does that code works to send e-ail normally ?
like, someone registers and the person that registers receive an e-mail ?
and what about to send a link to confirm the registration on the database ?

I'm screwd with my work...

Last edited by Zer0; 06-04-2010 at 06:58 AM..
Zer0 is offline
Reply With Quote
View Public Profile
 
Old 06-01-2010, 03:04 PM Re: PHP Mail Function to send html mail and attachments using Php Form Wizard
vectorialpx's Avatar
Extreme Talker

Posts: 241
Name: octavian
Location: Bucharest
Trades: 0
you can use PHP Mailer
http://sourceforge.net/projects/phpmailer/

use this
Code:
function send($m, $sub, $cont, $att=array()) {

		// To send HTML mail, FROM PHP.NET
		$headers  = 'MIME-Version: 1.0' . "\r\n";
		$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
		$headers .= 'To: ' . $m . "\r\n";
		$headers .= 'From: '.MAIL_FROM_NAME.' <'.MAIL_FROM_MAIL.'>' . "\r\n";
		// $headers .= 'Cc: birthdayarchive@example.com' . "\r\n";
		// $headers .= 'Bcc: birthdaycheck@example.com' . "\r\n";
		
		// use php_mailer class - ****!.. it works!
		/*
		$mail = new PHPMailer();
		$mail->IsSMTP(); // set mailer to use SMTP
		$mail->Host = "smtp.gmail.com"; // specify main and backup server
		$mail->Port = 465;
		$mail->SMTPAuth = true; // turn on SMTP authentication
		$mail->SMTPSecure = "ssl";
		$mail->Username = SMTP_USER; // SMTP username
		$mail->Password = SMTP_PASS; // SMTP password
		$mail->From = MAIL_FROM_MAIL;
		$mail->FromName = MAIL_FROM_NAME;
		$mail->AddAddress($m);
		if(!empty($att))
			foreach($att as $valAt)
				$mail->AddAttachment($valAt);
		$mail->IsHTML(true); // set email format to HTML
		$mail->Subject = $sub;
		$mail->Body = $cont;
		$mail->AltBody = 'Acest mail este in format HTML';
		// ... make send .....................
		if($mail->Send())
			return true;
		else */
		if(@mail($m, $sub, $cont, $headers))
			return true;
		else
			return false;
	}
__________________
you can
Please login or register to view this content. Registration is FREE
vectorialpx is offline
Reply With Quote
View Public Profile Visit vectorialpx's homepage!
 
Reply     « Reply to PHP Mail Function to send html mail and attachments using Php Form Wizard
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.19289 seconds with 12 queries