not recieving email

 
Post new topic   Reply to topic    PHP User Group Malta Forum Index // PHP Projects
View previous topic :: View next topic  
Author Message
viking



Joined: 04 Feb 2008
Posts: 2

PostPosted: Wed Feb 13, 2008 10:44 am    Post subject: not recieving email Reply with quote

 ghandi problema bil contact form. L-emails mhumiex jasluli go viking(at)maltanet.net, min info(at)justinmifsud.com (email forwarding)

xtista tkun il problema pls?

php:
<?php
// Contact subject
$subject=$_POST['subject'];
// Details
$message=$_POST['detail'];

// Mail of sender
$mail_from=$_POST['customer_mail'];

// From
$header="from: $name <$mail_from>";

// my email address
$to="info@justinmifsud.com";

$send_contact=mail($to,$subject,$message,$header);

if(
$send_contact){
echo 
"Message Sent!";
}
else {
echo 
"ERROR";
}
?>

Back to top
View user's profile Send private message
yancho
Site Admin


Joined: 13 Nov 2007
Posts: 56
Location: Iklin

PostPosted: Wed Feb 13, 2008 10:48 am    Post subject: Reply with quote

 As I am presuming, you are using third party forwarding, which I do not encourage - the more variables you introduce the bigger the chance of an error.

Also some of your script is bugged, these are my corrections :

php:

<?php
// Contact subject
$subject$_POST['$subject'];
// Details
$message$_POST['$detail'];

// Mail of sender
$customer_mail $_POST['customer_mail'];

//Your MAIN email
$mymail 'info@justinmifsud.com';
$secmail 'viking@maltanet.net';

// From
$headers "From: "$customer_mail "\r\n" .
    
" Reply-To: ".$mymail"\r\n" .
    
" X-Mailer: PHP/" phpversion();

$headers2 "From: "$mymail "\r\n" .
    
" Reply-To: ".$customer_mail"\r\n" .
    
" X-Mailer: PHP/" phpversion(); 
$send_contact=mail($myemail,$subject,$message,$header);


$send_contact2=mail($secmail,$subject,$message,$header);

$auto_reply "This is auto reply \n\n Thanks";

$send_contact3=mail($customer_mail,'Thanks for your query',$auto_reply,$header2);
if((
$send_contact) and ($send_contact2) and ($send_contact3)) {
echo 
"We've recived your contact information";
}
else {
echo 
"ERROR";
}


?>


Hope it helps Smile


_________________
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger ICQ Number
viking



Joined: 04 Feb 2008
Posts: 2

PostPosted: Wed Feb 13, 2008 10:51 am    Post subject: Reply with quote

 
yancho wrote:
As I am presuming, you are using third party forwarding, which I do not encourage - the more variables you introduce the bigger the chance of an error.

Also some of your script is bugged, these are my corrections :

php:

<?php
// Contact subject
$subject$_POST['$subject'];
// Details
$message$_POST['$detail'];

// Mail of sender
$customer_mail $_POST['customer_mail'];

//Your MAIN email
$mymail 'info@justinmifsud.com';
$secmail 'viking@maltanet.net';

// From
$headers "From: "$customer_mail "\r\n" .
    
" Reply-To: ".$mymail"\r\n" .
    
" X-Mailer: PHP/" phpversion();

$headers2 "From: "$mymail "\r\n" .
    
" Reply-To: ".$customer_mail"\r\n" .
    
" X-Mailer: PHP/" phpversion(); 
$send_contact=mail($myemail,$subject,$message,$header);


$send_contact2=mail($secmail,$subject,$message,$header);

$auto_reply "This is auto reply \n\n Thanks";

$send_contact3=mail($customer_mail,'Thanks for your query',$auto_reply,$header2);
if((
$send_contact) and ($send_contact2) and ($send_contact3)) {
echo 
"We've recived your contact information";
}
else {
echo 
"ERROR";
}


?>


Hope it helps Smile



thanks vmuch

Back to top
View user's profile Send private message
varactor



Joined: 22 Dec 2008
Posts: 10
Location: Malta

PostPosted: Mon Dec 22, 2008 1:54 pm    Post subject: Reply with quote
What are you using a Windows Server or Linux?

If Linux check that your sendmail path is OK.
On Windows check php.ini for the smtp setting.
For example, on my Windows server the smtp setting is as follows..
( approx Line 698 )

[mail function]
; For Win32 only.
SMTP = mail.maltanet.net
smtp_port = 25

On Linux ( Debian ) everything should be OK by default, so an error have to be happening at the PHP script itself.

Good Luck, reply if you need any more help, and even if you have it fixed.
Back to top
View user's profile Send private message Visit poster's website
Post new topic   Reply to topic    PHP User Group Malta Forum Index // PHP Projects All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

alexisRed v1.2 // Theme Created By: Andrew Charron and Web Hosting Bluebook // Icons in Part By: Travis Carden
Boards optimised using the phpBB-SEO mod found at phpbb-seo.com
Boards hosted courtesy of solutions-lab.net
Link Backs : PHPClasses.org - MT Page :: PHPUsergroups.org - MT Page



Powered by phpBB © 2001, 2002 phpBB Group