Go Back   Web Hosting UK Forums | Linux Windows Dedicated Server and cPanel VPS Hosting Forum > Services > Web Designing and Development

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 09-09-2007, 07:28 AM
SBh SBh is offline
Member
 
Join Date: Sep 2007
Posts: 58
Default PHP classes for mailing.

Most of us like to use php mail() to send mail. However, the use of this function become complex in case of doing complex job, suppose you want to send a large attachment and whose size is bigger than the php memory limit.
To simplify these cases there certain mailing classes. One of the most popular is PHPMailer class phpmailer.sourceforge.net/ . I am using it for long time and it is much convenient to use than ordinary mail function.
However the development of that class has been stopped. Recently I faced a problem while sending a attachment through PHPMailer whose size was bigger than php memory limit. There was no way out of that. Then I searched for another mailer class and got Swift Mailer swiftmailer.org/ , this one is really good in features and seems to be better than PHPmailer, I haven't yet used it but hope it will be better.

Hope this will be helpful to many people specially to those who face similar problem like me. And if you know any other similar class then please tell me that also.
Reply With Quote
  #2 (permalink)  
Old 10-15-2007, 04:37 PM
Banned
 
Join Date: Oct 2007
Posts: 11
Cool

yea.........!

i have hardly get this codings.

this in contact.html
HTML Code:
<form method="POST" action="contact.php">
Fields marked (*) are required

<p>Name:
<input type="text" name="Name">
<p>Address:
<input type="text" name="Address">
<p>Phone:
<input type="text" name="Phone">
<p>Website:
<input type="text" name="Website">
<p>Comments:
<textarea name="Comments"></textarea>
<p><input type="submit" name="submit" value="Submit">
</form>

and this in contact.php
PHP Code:
<?php
// Website Contact Form Generator 
// http://www.tele-pro.co.uk/scripts/contact_form/ 
// This script is free to use as long as you  
// retain the credit link  

// get posted data into local variables
$EmailFrom "Server...email from";
$EmailTo "gyanuman@gmail.com";
$Subject "Msg from server.....subject";
$Name Trim(stripslashes($_POST['Name'])); 
$Address Trim(stripslashes($_POST['Address'])); 
$Phone Trim(stripslashes($_POST['Phone'])); 
$Website Trim(stripslashes($_POST['Website'])); 
$Comments Trim(stripslashes($_POST['Comments'])); 

// validation
$validationOK=true;
if (!
$validationOK) {
  print 
"<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">";
  exit;
}

// prepare email body text
$Body "";
$Body .= "Name: ";
$Body .= $Name;
$Body .= "\n";
$Body .= "Address: ";
$Body .= $Address;
$Body .= "\n";
$Body .= "Phone: ";
$Body .= $Phone;
$Body .= "\n";
$Body .= "Website: ";
$Body .= $Website;
$Body .= "\n";
$Body .= "Comments: ";
$Body .= $Comments;
$Body .= "\n";

// send email 
$success mail($EmailTo$Subject$Body"From: <$EmailFrom>");

// redirect to success page 
if ($success){
  print 
"The message has been send";
}
else{
  print 
"The message was send";
}
?>
Reply With Quote
Reply

Thread Tools
Display Modes

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 On
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 12:48 AM.
Copyright 2002-2007 WebHosting.uk.com. All rights reserved.
Web Hosting UK Forum