1 |
hello everybody!.. |
2 |
|
3 |
trying to use mail() + ssmtp in a php script but no way.. |
4 |
|
5 |
my host: pc-0001.localarea |
6 |
mail server: pc-0004.localarea |
7 |
|
8 |
I can send mail to remote smtp server thru ssmtp (and its alias |
9 |
sendmail) via command line (and can also pop back to my client), but if |
10 |
I try from php, the apache log says "sendmail: No recipients supplied - |
11 |
mail will not be sent". Note that php condition is true. |
12 |
|
13 |
any help?? |
14 |
|
15 |
thanks, |
16 |
Stefano. |
17 |
|
18 |
|
19 |
|
20 |
here my files: |
21 |
|
22 |
<? |
23 |
/* php script: */ |
24 |
mail("stefano@×××××××.localarea","subject","text"); |
25 |
if(mail("stefano@×××××××.localarea","soggetto","testo")) echo "mail |
26 |
sent"; |
27 |
?> |
28 |
|
29 |
# |
30 |
# /etc/ssmtp.conf -- a config file for sSMTP sendmail. |
31 |
# |
32 |
|
33 |
# The person who gets all mail for userids < 1000 |
34 |
# Make this empty to disable rewriting. |
35 |
root=stefano@×××××××.localarea |
36 |
|
37 |
# The place where the mail goes. The actual machine name is required |
38 |
# no MX records are consulted. Commonly mailhosts are named |
39 |
mail.domain.com |
40 |
# The example will fit if you are in domain.com and your mailhub is so |
41 |
named. |
42 |
mailhub=pc-0004.localarea |
43 |
|
44 |
# Example for SMTP port number 2525 |
45 |
# mailhub=mail.your.domain:2525 |
46 |
# Example for SMTP port number 25 (Standard/RFC) |
47 |
# mailhub=mail.your.domain |
48 |
# Example for SSL encrypted connection |
49 |
# mailhub=mail.your.domain:465 |
50 |
|
51 |
# Where will the mail seem to come from? |
52 |
rewriteDomain= |
53 |
|
54 |
# The full hostname |
55 |
|
56 |
# Gentoo bug #47562 |
57 |
# Commenting the following line will force ssmtp to figure |
58 |
# out the hostname itself. |
59 |
|
60 |
# hostname=_HOSTNAME_ |
61 |
|
62 |
# Set this to never rewrite the "From:" line (unless not given) and to |
63 |
# use that address in the "from line" of the envelope. |
64 |
#FromLineOverride=YES |
65 |
|
66 |
# Use SSL/TLS to send secure messages to server. |
67 |
#UseTLS=YES |
68 |
|
69 |
# Use SSL/TLS certificate to authenticate against smtp host. |
70 |
#UseTLSCert=YES |
71 |
|
72 |
# Use this RSA certificate. |
73 |
#TLSCert=/etc/ssl/certs/ssmtp.pem |
74 |
|
75 |
************************************************************* |
76 |
|
77 |
# /etc/ssmtp/revaliases |
78 |
# sSMTP aliases |
79 |
root:stefano@×××××××.localarea:pc-0004.localarea |
80 |
|
81 |
************************************************************* |
82 |
|
83 |
#/etc/php/apache2-php5/php.ini |
84 |
#/etc/php/cli-php5/php.ini |
85 |
[mail function] |
86 |
; For Win32 only. |
87 |
;SMTP = localhost |
88 |
;smtp_port = 25 |
89 |
|
90 |
; For Win32 only. |
91 |
;sendmail_from = me@×××××××.com |
92 |
|
93 |
; For Unix only. You may supply arguments as well (default: "sendmail |
94 |
-t -i"). |
95 |
sendmail_path=/usr/sbin/sendmail |
96 |
|
97 |
; Force the addition of the specified parameters to be passed as extra |
98 |
parameters |
99 |
; to the sendmail binary. These parameters will always replace the value |
100 |
of |
101 |
; the 5th parameter to mail(), even in safe mode. |
102 |
;mail.force_extra_parameters = |
103 |
|
104 |
|
105 |
|
106 |
-- |
107 |
gentoo-user@g.o mailing list |