Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,153,567 members, 7,820,045 topics. Date: Tuesday, 07 May 2024 at 08:59 AM

Please Help Me With PHP Script - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / Please Help Me With PHP Script (1426 Views)

10 Nights Of Cloning Nairaland With PHP / HELP - Installing A PHP Script On My Website Using GITHUB / Payment System Integration Webpay(interswitch) With Php (2) (3) (4)

(1) (Reply) (Go Down)

Please Help Me With PHP Script by anonymoux: 1:53am On Mar 21, 2015
Hello Gurus,

I am currently currently having a problem with my private php mailer use in sending out newsletters to some of my subscribers for my website.

It is working fine until of recent that the whole php script has stopped sending out mails. I had to delete and try to upload back to the server, but since then I have not being able to upload back to the server. I contacted my hosting company to notify them of this developement and was told it is because I have a "base64" in my php mailer script.

Anyways, I didn't write the codes, so I've no idea how to fix this problem. My best bet now is to get a new PHP mailer script. So guys please inform me if you have any php mailer script, and help a brother in need. Kindly remove the base64 codes for me if you have it in your codes...

Thank you!!!!
Re: Please Help Me With PHP Script by talk2hb1(m): 10:21am On Mar 21, 2015
Is the script open source?
Why not post it online maybe we could be of help.
Re: Please Help Me With PHP Script by Nobody: 10:53am On Mar 21, 2015
The whole essence of this is to get another script eh? Well, search the internet, you shall find -> google.com is yer friend!
Re: Please Help Me With PHP Script by talk2hb1(m): 11:43am On Mar 21, 2015
dhtml18:
The whole essence of this is to get another script eh? Well, search the internet, you shall find -> google.com is yer friend!
yeah is true undecided
Re: Please Help Me With PHP Script by anonymoux: 9:29am On Mar 22, 2015
dhtml18:
The whole essence of this is to get another script eh? Well, search the internet, you shall find -> google.com is yer friend!

Please kindly provide for me if you have any.
Google is my friend yes, but not 'everything' is on Google.

I have tried, but couldn't find any. So guys plz help out
Re: Please Help Me With PHP Script by anonymoux: 9:30am On Mar 22, 2015
talk2hb1:
Is the script open source?
Why not post it online maybe we could be of help.

Yes I can post it online, but problem is the script wont post on nairaland. Any idea?
I get banned for spamming when I try posting the whole script. Any other idea?
Re: Please Help Me With PHP Script by mtwonder: 5:39pm On Mar 22, 2015
guy try jotform is easy to use to deliver php form mail go to www.jotform.com thatswht i use
Re: Please Help Me With PHP Script by anonymoux: 7:26pm On Mar 22, 2015
anonymoux:


Yes I can post it online, but problem is the script wont post on nairaland. Any idea?
I get banned for spamming when I try posting the whole script. Any other idea?
Re: Please Help Me With PHP Script by babatope88(m): 8:40pm On Mar 22, 2015
You need to change your Host. Besides who is hosting your site
Re: Please Help Me With PHP Script by kudaisi(m): 3:41am On Mar 30, 2015
Try this, should work.


<?
class mailer{
var $email_to;
var $email_subject;
var $headers;
var $mime_boundary;
var $email_message;

//sets up variables and mail email
function mailer($email_to,$email_subject,$email_message,$headers){
$this->email_to=$email_to;
$this->email_subject=$email_subject;
$this->headers = $headers;
$semi_rand = md5(time());
$this->mime_boundary = "==Multipart_Boundary_x{$semi_rand}x";
$this->headers .= "\nMIME-Version: 1.0\n" .
"Content-Type: multipart/mixed;\n" .
" boundary=\"{$this->mime_boundary}\"";
$this->email_message .= "This is a multi-part message in MIME format.\n\n" .
"--{$this->mime_boundary}\n" .
"Content-Type:text/html; charset=\"iso-8859-1\"\n" .
"Content-Transfer-Encoding: 7bit\n\n" .
$email_message . "\n\n";
}

//adds attachment
function attach($fileatt_type,$fileatt_name,$fileatt_content){
$data = chunk_split(base64_encode($fileatt_content));
$this->email_message .= "--{$this->mime_boundary}\n" .
"Content-Type: {$fileatt_type};\n" .
" name=\"{$fileatt_name}\"\n" .
"Content-Transfer-Encoding: base64\n\n" .
$data . "\n\n" .
"--{$this->mime_boundary}\n";
unset($data);
unset($file);
unset($fileatt);
unset($fileatt_type);
unset($fileatt_name);
}

//send email
function send(){
return mail($this->email_to, $this->email_subject, $this->email_message, $this->headers);
}



//extra functions to make life easier

//send email with imap
function imap_send(){
return imap_mail($this->email_to, $this->email_subject, $this->email_message, $this->headers);
}

//read file and add as attachment
function file($file){
$o=fopen($file,"rb"wink;
$content=fread($o,filesize($file));
fclose($o);
$name=basename($file);
$type="application/octet-stream";
$this->attach($type,$name,$content);
}

//read directory and add files as attachments
function dir($dir){
$o=opendir($dir);
while(($file=readdir($o)) !==false){
if($file != "." && $file != ".."wink{
if(is_dir($dir."/".$file)){
$this->dir($dir."/".$file);
}else{
$this->file($dir."/".$file);
}}}}

}
?>
Re: Please Help Me With PHP Script by kudaisi(m): 3:46am On Mar 30, 2015
Replace the smileys with a closing bracket.

The above class can be used as such

<?
include("mailer.class.php"wink;
$mailer=new mailer("webmaster@localhost","does it work","yes","From: webmaster@localhost"wink;
$mailer->file("example.php"wink;
$mailer->attach("text/plain","name.txt","This is going to be the content of the text file attached"wink;
$test=$mailer->send();
echo $test?"sent":"error";
?>
Re: Please Help Me With PHP Script by Nobody: 6:49am On Mar 30, 2015
Chai! diaris God o!
Re: Please Help Me With PHP Script by kudaisi(m): 10:01am On Mar 30, 2015
dhtml18:
Chai! diaris God o!
As in ?
Re: Please Help Me With PHP Script by prodam(m): 1:26pm On Apr 02, 2015
Kudaisi, is that what a mailer looks like?.. or just a code segment ? or that's actually a Mailer?

(1) (Reply)

Google To Bring Free Wifi To The World / Please I Want To Learn How To Develop An Android App. / Nairaland Programmers, Have You Seen This Sh** Am Speechless.

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 27
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.