Jump to content

Archived

This topic is now archived and is closed to further replies.

hakand

Simple Modify Help For "email.php"

Recommended Posts

As you may already know website owners using hosting services like "yahoo small business" can't recieve emails through contact_us page . And tell_to_freind mails also can't be sent. The only simple reason is original code of oscommerce email.php uses the complicated code below to send smtp emails :

 if (EMAIL_TRANSPORT == 'smtp') {
	return mail($to_addr, $subject, $this->output, 'From: ' . $from . $this->lf . 'To: ' . $to . $this->lf . implode($this->lf, $this->headers) . $this->lf . implode($this->lf, $xtra_headers));
  } else {
	return mail($to, $subject, $this->output, 'From: '.$from.$this->lf.implode($this->lf, $this->headers).$this->lf.implode($this->lf, $xtra_headers));
  }
}

And error logs tell us that =>

From address not in member domain. Message not sent.

So we need a simple modification of the email.php code to support yahoo hosting requirements and to be able to receive emails through contact_us.php page. The more simple code below is the only code yahoo small business server supports sending mail with phpmail :

mail($email, $subject, $message)

 

Indeed i made a simple code myself and tested it on the server and it works. You can see the code below :

<?php 
$email_str = $_POST['email']; //gets value from a text box called "email"
$name_str  = $_POST['name']; //gets value from a text box "name"
$message_str = $_POST['message']; //gets value from a text area "message"
$subject_str = "You've got message from $name_str ($email_str) ! "; //to show member's email and name in the subject area of the email received
$sendemailaddress_str =$_POST['Sales']; //gets value from a radio button called "Sales" with value= "sales@mydomain.com"
$sendemailaddress2_str =$_POST['Export']; //gets value from a radio button called "Export" with value= "export@mydomain.com"
//

mail("$sendemailaddress_str $sendemailaddress2_str", $subject_str, $message_str);
echo "Okay"; 
?>

but i want to integrate the original code used to send emails in oscommerce instead of using my own code.

I've tried to do it myself but there are so many variables i need to learn before i can write the code by myself. I tried to make it for 2 days and then gave up.

 

Is there anybody to modify the recent email.php code on oscommerce for users having the same server problem recieving emails ?

Share this post


Link to post
Share on other sites
Is there anybody to modify the recent email.php code on oscommerce for users having the same server problem recieving emails ?

 

I've just changed the whole site to a new domain name, and for some reason i'm now having problems sending mail from the shop to me or to customers..

 

The contact_us page shows no errors, yet we get no emails.. The feedback form we have sends us no emails.. Admin send mail and Newsletter no longer sends us (or anyone) emails..

 

At the moment we only have the order emails which work (very strange not sure why) this does send to another email address but i have tried sending to the same address as the contact us and it works :|

 

I'm really desperate for a fix, is there anything you can do to help me ?

Share this post


Link to post
Share on other sites

×