Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

Secure Mail form


  • Please log in to reply
4 replies to this topic

#1 KamakaZ

KamakaZ

  • Members
  • 739 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Victoria
  • Local time:10:32 PM

Posted 03 February 2009 - 10:10 PM

I'm after a php script that:

- Has a form that i can put into a .html page that calls the script,
- Is able to tell a smpt server that it is USER: xxxx with a PASS: xxxx

I have set up my mail server to not allow relaying, so when i use other mailing scripts, my SMTP server gets it but won't forward it on because no user/mail from was specified.

Can anyone help me out? Or is this relating to a setting in my php.ini file? i think i can remember one being in there relating to this...

This is the script i have at the moment:


<?php
 
// Contact subject
$subject ="$subject"; 
// Details
$message="$detail"; 
 
// Mail of sender
$mail_from="$customer_mail"; 
// From 
$header="from: $name <$mail_from>"; 
 
// Enter your email address
$to ='Brad@forum-indoor.info'; 
 
$send_contact=mail($to,$subject,$message,$header, "From: Brad@forum-indoor.info");
 
// Check, if message sent to your email 
// display message "Thanks for the message!"
if($send_contact){
header("Location: contact_success.html");
}
else {
echo "ERROR";
}
?>

Any Idea's? :thumbsup:

There's no place like 127.0.0.1
There are 10 types of people in the world, those that can read binary, and those who can't.


BC AdBot (Login to Remove)

 


#2 webrat

webrat

  • Members
  • 138 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:UK
  • Local time:12:32 PM

Posted 06 February 2009 - 12:16 PM

Hey KamakaZ,

I'm no PHP expert but have been looking at this

http://www.swiftmailer.org/

for site security. Seems to offer a number of features whilst stopping/limiting header attacks through the standard PHP mail function which I was going to use....

#3 InterestinglyAverage

InterestinglyAverage

  • Members
  • 111 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:United States
  • Local time:07:32 AM

Posted 06 February 2009 - 12:45 PM

Generally, the PHP mail() function will use sendmail, as designated by php.ini. It is in the sendmail configuration that you need to specify your login credentials for the remote SMTP server. Check this page out for some information on how to do that: http://dbaron.org/linux/sendmail This is redhat specific, but it should be adaptable for any LAMP server.
The only way to learn anything is to question everything.

#4 KamakaZ

KamakaZ
  • Topic Starter

  • Members
  • 739 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Victoria
  • Local time:10:32 PM

Posted 08 February 2009 - 04:49 PM

Generally, the PHP mail() function will use sendmail, as designated by php.ini. It is in the sendmail configuration that you need to specify your login credentials for the remote SMTP server. Check this page out for some information on how to do that: http://dbaron.org/linux/sendmail This is redhat specific, but it should be adaptable for any LAMP server.


I can't do that, i'm running xampp on a windows box. I have changed the credentials in the php.ini as suggested by xampp, by the mail still doesn't even reach the server, no messages or logs come up on it, yet if i send mail from a wordpress blog, it sends fine.

There's no place like 127.0.0.1
There are 10 types of people in the world, those that can read binary, and those who can't.


#5 Abhay

Abhay

  • Members
  • 3 posts
  • OFFLINE
  •  
  • Local time:05:02 PM

Posted 14 February 2009 - 12:10 AM

Hi KamakaZ, i am not a PHP developer but i can suggest you to find your problem from www.php.net website. it's totally for PHP programmers...




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users