Welcome to Geeklog, Anonymous Wednesday, December 25 2024 @ 10:38 am EST
Geeklog Forums
SMTP auth
Anonymous
Anonymous
The smtp server I use for php requires authentication - how do I set up the username and password...
Or am I missing the bigger picture??
Thanks, Alex Kerin
11
15
Quote
Status: offline
emagin
Forum User
Regular Poster
Registered: 08/05/03
Posts: 92
I have the same problem.
My mail server requires authentication to send mail.
All my Geeklog initiated mail sessions end with errors:
PHP Warning: mail(): SMTP server response: 530 Authentication required in ...public_htmladminmail.php on line 183, referer: http://.../admin/mail.php
10
13
Quote
Status: offline
LewisR
Forum User
Junior
Registered: 06/30/03
Posts: 29
For authenticated SMTP, you\'ll need to reconfigure sendmail (or whatever MTA you\'re using. The PHP mail function merely passes the data to the external app; it has no provision for special SMTP functions.
For sendmail, you\'ll want to probably make entries to the following:
In your sendmail.cf (or .cf8), you\'ll want to be sure to use the DefaultAuthInfo directive, and set it to point to the file containing your authentication data, usually, /etc/sendmail/default-auth-info (but it can be anywhere in the filesystem).
The file default-auth-info needs to have something similar to the following:
AuthInfo:smtp.domain.com \"U:username\" \"P=password\"
Now, when you pass your mail to your gateway (the above configuration assumes you\'re using sendmail in \"dumb\" mode, simply passing mail to another SMTP server for processing), as defined by \"smtp.domain.com\" (you\'ll need this to be the gateway server defined in sendmail.cf as your smart relay host, via the DS directive), it will reference the username & password defined in default-auth-info, and your mail should go through.
HTH
Lewis Rosenthal, CNA, CLP, CLE
Rosenthal & Rosenthal, LLC
Lewis Rosenthal, CNA, CLP, CLE
Rosenthal & Rosenthal, LLC
11
12
Quote
Status: offline
emagin
Forum User
Regular Poster
Registered: 08/05/03
Posts: 92
Pardon me, I\'m using windows and have not been able to find sendmail.cf anywhere.
Is there any chance you could elaborate on this. Sorry if this is a dumb question, but I have little clue sa to where this stuff is.
I have a sendmail.dll in my /winnt/ directory, but that\'s it.
This is the only thing holding back my Geeklog site launch!
10
12
Quote
Status: offline
emagin
Forum User
Regular Poster
Registered: 08/05/03
Posts: 92
I\'ve found PHP Mailer which seems to offer everything that PHP (mail) does not have.
As a PHP newbie, I\'m surprised at how weak mail is in PHP.
An example below lets you set SMTP Authentication fine.
I\'ve tested it and it works with my servers.
However, I have no idea where to start taking apart /admin/mail.php and other files. It\'s too complex for me to get straight.
Can anyone out there help out? For now all I care about is letting users register and receive their PW via email, and forum alerts (although this is optional!).
Thanks
========================================
require(\"class.phpmailer.php\");
$mail = new PHPMailer();
$mail->IsSMTP(); // set mailer to use SMTP
$mail->Host = \"smtp1.example.com;smtp2.example.com\"; // specify main and backup server
$mail->SMTPAuth = true // turn on SMTP authentication
$mail->Username = \"jswan\" // SMTP username
$mail->Password = \"secret\" // SMTP password
$mail->From = \"from@example.com\";
$mail->FromName = \"Mailer\";
$mail->AddAddress(\"josh@example.net\", \"Josh Adams\");
$mail->AddAddress(\"ellen@example.com\"); // name is optional
$mail->AddReplyTo(\"info@example.com\", \"Information\");
$mail->WordWrap = 50; // set word wrap to 50 characters
$mail->AddAttachment(\"/var/tmp/file.tar.gz\"); // add attachments
$mail->AddAttachment(\"/tmp/image.jpg\", \"new.jpg\"); // optional name
$mail->IsHTML(true); // set email format to HTML
$mail->Subject = \"Here is the subject\";
$mail->Body = \"This is the HTML message body in bold!\";
$mail->AltBody = \"This is the body in plain text for non-HTML mail clients\";
if(!$mail->Send())
{
echo \"Message could not be sent.
\"; echo \"Mailer Error: \" . $mail->ErrorInfo; exit; } echo \"Message has been sent\"; ?>
11
11
Quote
Status: offline
Euan
Forum User
Full Member
Registered: 04/22/02
Posts: 292
The mail is actually sent with line 182-183:
if ( !mail($A[\'email\'], stripslashes ( $vars[\'subject\'] ),
stripslashes ( $vars[\'message\'] ), $headers) ) {
$failures[] .= $til;
} else {
$successes[] = $til;
}
The mail headers are contained in $headers, the \"to\" address in $A[\'email\'], the subject in $vars[\'subject\'], and the body in $vars[\'message\']. With that, you should be able to make the PHP mailer script work.
Cheers,
Euan.
-- Heather Engineering
-- No job too small
-- Heather Engineering
-- No job too small
14
11
Quote
Ok I am not quite there yet, but this hack and explanation at LocalSteve\'s site is it.
PLEASE NOTE - Dirk is currently working on a similar Pear implementation for GL, so you may want to see what the status is there before embarking on this one.
As soon as I get it working I\'ll report back.
(and take heart you non-coders, I\'m fairly clueless and making good progress!)
13
15
Quote
Status: offline
emagin
Forum User
Regular Poster
Registered: 08/05/03
Posts: 92
Hate to tell you this but I spent a couple hours messing with this in Windows. I went to the Pear binaries downloads, got the latest install, and ran the .bat file to install for win32.
That seemed to work ok.
Then I pointed the various pear paths to c:/php/pear/mail/... etc. (win32 only!) and set that up properly.
But I couldn\'t get it to work. I got some errors and gave up.
I\'m sort of hoping Dirk\'s Pear implementation will come out soon, although I think he got a new job so that might not happen.
11
11
Quote
Status: offline
destr0yr
Forum User
Full Member
Registered: 07/06/02
Posts: 324
I downloaded the nightly CVS of geeklog and it seems to work fine with smtp auth... however, its probably not something that they would fully support as its in development and it would be fun upgrading when gl 1.3.9 comes out.. (just a guess @ version #)
-- destr0yr
"I love deadlines. I like the whooshing sound they make as they fly by." -- Douglas Adams
-- destr0yr
"I love deadlines. I like the whooshing sound they make as they fly by." -- Douglas Adams
10
13
Quote
Status: offline
DTrumbower
Forum User
Moderator
Registered: 01/08/03
Posts: 507
Quote by destr0yr: I downloaded the nightly CVS of geeklog and it seems to work fine with smtp auth... however, its probably not something that they would fully support as its in development and it would be fun upgrading when gl 1.3.9 comes out.. (just a guess @ version #)
Do you have a support contract?
If its in CVS, you surely can use it and ask questions about it. Maybe the response might be slower because more debuging might be needed to answer the question. But there is nothing wrong with more people using/testing cvs. Just realize that it could have some problems. But since Dhaun coded it, probably not.
11
11
Quote
Status: offline
Dirk
Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Quote by DTrumbower:But there is nothing wrong with more people using/testing cvs.
Yep. That counts as one way to help Geeklog.
Quote by DTrumbower:Just realize that it could have some problems.
... or that incompatible changes (in code or in the database) could happen, usually without a warning (also see the \"General Notes\" on the CVS page).
bye, Dirk
10
15
Quote
All times are EST. The time is now 10:38 am.
- Normal Topic
- Sticky Topic
- Locked Topic
- New Post
- Sticky Topic W/ New Post
- Locked Topic W/ New Post
- View Anonymous Posts
- Able to post
- Filtered HTML Allowed
- Censored Content