• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 448
  • Last Modified:

PHP+Qmail+SMTP

Ok, I am going mad.
I have a fedora 4 box. Plesk 8.2 installed using qmail and have 4 public ip addresses hosting web sites.
for example,
domain1 is assigned to xxx.xxx.xxx.001
domain2 is assigned to xxx.xxx.xxx.002
etc.
how can I simply send email within php?
0
bilgehanyildirim
Asked:
bilgehanyildirim
  • 4
  • 4
1 Solution
 
bilgehanyildirimAuthor Commented:
I tried this
                        $sendMail = new phpmailer();
            $sendMail->Mailer = 'smtp';
            $sendMail->IsSMTP();
            $sendMail->SMTPAuth= true;            
            $sendMail->From = 'notification@domain1.com';
            $sendMail->FromName = notification Service';
            $sendMail->Host = 'mail.domain1.com';
            $sendMail->Username = 'notification@domain1.com';
            $sendMail->Password = xxxxxx;
            $sendMail->Body = $this->messageHTML;
            $sendMail->AltBody = $this->messageTXT;
            $sendMail->Subject = $this->subject;
            $sendMail->AddAddress($toUser->getEmailAddress(),$toUser->getScreenName());
          if(!$sendMail->Send()){
                $sendMail->ClearAddresses();
                $sendMail->ClearAttachments();
                return false;
          }else{
                $sendMail->ClearAddresses();
                $sendMail->ClearAttachments();
                return true;
          }
and I received and error mail saying
Hi. This is the qmail-send program at domain1com.
I'm afraid I wasn't able to deliver your message to the following addresses.
This is a permanent error; I've given up. Sorry it didn't work out.

<bill@zzzzz.com>:
Connected to xxx.xxx.xxx.123 but sender was rejected. --->[[[this ip address is one of my other ip address which is not assigned to domain1.com]]]]
Remote host said: 530 Authentication required

--- Below this line is a copy of the message.

 

0
 
orbic1Commented:
how can I simply send email within php?
-------

mail() function ??

mail ($to, $subject, $message [, $additional_headers [, $additional_parameters]] );

http://uk3.php.net/manual/en/function.mail.php
0
 
orbic1Commented:
If you need to use SMTP rather than sendmail - let me know - I have functions already written up for this. Also I have some functions for sendmail and SMTP which can handle attachments straight from the file directory!
0
Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

 
bilgehanyildirimAuthor Commented:
orbic1,
could you tell me what is wrong with my code above?
0
 
bilgehanyildirimAuthor Commented:
My bad. please ignore this question...
0
 
orbic1Commented:
The whole question or just the last bit? How are you getting on?
0
 
bilgehanyildirimAuthor Commented:
Whole question.
Actually error mail I received was coming from receivers email server saying
Connected to xxx.xxx.xxx.123 but sender was rejected.
Remote host said: 530 Authentication required
so nothing is wrong with my qmail or php settings :)
0
 
orbic1Commented:
excellent! ;-)
0

Featured Post

Transaction-level recovery for Oracle database

Veeam Explore for Oracle delivers low RTOs and RPOs with agentless transaction log backup and transaction-level recovery of Oracle databases. You can restore the database to a precise point in time, even to a specific transaction.

  • 4
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now