Jump to content


Photo

php mail through user


  • Please log in to reply
2 replies to this topic

#1 leeroy78

leeroy78
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 14 March 2006 - 01:38 AM

Hi,

We're having a problem with our php form sending to yahoo, aol, etc. The script is below. I believe it's using the standard SMTP of the server. I'd like it to use a username and password to authenticate through one of my accounts in mailenable and use that SMTP. Thanks.

<?php

// send to variables
//---- START EDIT HERE ------

$sendTo = $_POST["email"];
$subject = "Question";

/// ---- STOP EDIT HERE ------

// header information not including sendTo and Subject
// these all go in one variable. First, include From:
$headers = "From: " . $_POST["name"] ." ". "<" . $_POST["email"] .">\r\n";
// next include a replyto
$headers .= "Reply-To: " . $_POST["email"] . "\r\n";
// often email servers won't allow emails to be sent to
// domains other than their own. The return path here will
// often lift that restriction so, for instance, you could send
// email to a hotmail account. (hosting provider settings may vary)
// technically bounced email is supposed to go to the return-path email
$headers .= "Return-path: " . $_POST["email"];

// now we can add the content of the message to a body variable
$body = "Full Name: " . $_POST["name"] ."\r\n". "Email: " . $_POST["email1"] ."\r\n\r\n". "--------Ask The Doctor--------" . "\r\n" . "Message: " . $_POST["message"];

// once the variables have been defined, they can be included
// in the mail function call which will send you an email
mail($sendTo, $subject, $body, $headers);

?>

#2 hitman6003

hitman6003
  • Members
  • PipPipPip
  • Advanced Member
  • 1,807 posts

Posted 14 March 2006 - 01:48 AM

This is not a service.

If you would like help learning how to do something using php, then please ask.

#3 leeroy78

leeroy78
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 14 March 2006 - 04:16 AM

[!--quoteo(post=354742:date=Mar 13 2006, 08:48 PM:name=hitman6003)--][div class=\'quotetop\']QUOTE(hitman6003 @ Mar 13 2006, 08:48 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
This is not a service.

If you would like help learning how to do something using php, then please ask.
[/quote]

I thought I was asking




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users