Можно ли в настройках php-сервера указать smtp настройки и функция mail() отправляла бы через внешний smtp сервер, предположим gmail?
Пользователь решил продолжить мысль 02 Декабря 2011, 12:47:31:
Пытался настроить по
руководству:
# cat /etc/exim4/update-exim4.conf.conf
dc_eximconfig_configtype='internet'
dc_other_hostnames='vps-debian-lenny-i386.ukraine.com.ua.ukraine.com.ua'
dc_local_interfaces='127.0.0.1'
dc_readhost=''
dc_relay_domains=''
dc_minimaldns='false'
dc_relay_nets=''
dc_smarthost='smtp.gmail.com::465'
CFILEMODE='644'
dc_use_split_config='false'
dc_hide_mailname=''
dc_mailname_in_oh='true'
dc_localdelivery='mail_spool'
# cat /etc/exim4/passwd.client
smtp.gmail.com:artemhp@gmail.com:123
# cat /etc/email-addresses
www-data:artemhp@gmail.com
не получается
# exim -d
Exim version 4.69 uid=0 gid=0 pid=24263 D=fbb95cfd
Berkeley DB: Berkeley DB 4.6.21: (September 27, 2007)
Support for: crypteq iconv() IPv6 GnuTLS move_frozen_messages
Lookups: lsearch wildlsearch nwildlsearch iplsearch cdb dbm dbmnz dnsdb dsearch nis nis0 passwd
Authenticators: cram_md5 plaintext
Routers: accept dnslookup ipliteral manualroute queryprogram redirect
Transports: appendfile/maildir/mailstore autoreply lmtp pipe smtp
Fixed never_users: 0
Size of off_t: 8
changed uid/gid: forcing real = effective
uid=0 gid=0 pid=24263
auxiliary group list: <none>
seeking password data for user "uucp": cache not available
getpwnam() succeeded uid=10 gid=10
configuration file is /var/lib/exim4/config.autogenerated
log selectors = 00000ffc 00612001
Reset TZ to NULL: time is 2011-12-02 03:24:45
cwd=/var/log 2 args: exim -d
trusted user
admin user
changed uid/gid: privilege not needed
uid=101 gid=103 pid=24263
auxiliary group list: 103
seeking password data for user "mail": cache not available
getpwnam() succeeded uid=8 gid=8
user name "root" extracted from gecos field "root"
originator: uid=0 gid=0 login=root name=root
sender address = root@#vps-debian-lenny-i386.ukraine.com.ua.ukraine.com.ua
Exim is a Mail Transfer Agent. It is normally called by Mail User Agents,
not directly from a shell command line. Options and/or arguments control
what it does when called. For a list of options, see the Exim documentation.
# /etc/init.d/exim4 restart
Stopping MTA for restart:hostname --fqdn did not return a fully qualified name, dc_minimaldns will not
work. Please fix your /etc/hosts setup.
exim4_listener.
Restarting MTA: exim4.
vps-1092:/var/log#