# SMTP sendmail and gmail for users [solved] e107 phpBB

## bungernut

This wiki is awesome but it sets up a single sendmail account for my server: http://www.gentoo-wiki.info/HOWTO_Gmail_and_sSMTP

But on my web server server I am setting up with apache2_opt -D userdir (users have a public_html folder and can host some form of website). SMTP through PHP never seems to work although I see this to be probably the correct way to allow each user to setup mail for their respective sites.

I have e107 and phpBB4 as examples of PHP apps that cant seem to work through their internal SMTP options, but through the wiki above sendmail does work.

These are things I assume are important:

make.conf (part)

```
USE="gstreamer X gtk gnome alsa aac a52 acpi css exif png gtk2 quicktime opengl xvid jpeg win32codecs mp3 mpeg mplayer pulseaudio usb theora xine vcd pdf ogg gif flac esd dvd dvdr cdr mad a52 3dnow 3dnowext sse mmx mmxext faac faad2 libmad libdvdread ffmpeg xine-lib truetype javascript dbus cups gimp gpm java javascript jabber firefox scanner v4l v4l2 xscreensaver nsplugin ppds spell accessibility encode vorbis cairo xvmc lm_sensors nvidia hal latex x264 tiff dvb ssl sse2 speex raw jpeg2k hddtemp svg"

```

package.use

```
dev-lang/php apache2 bzip2 cgi cli ctype curl dba expat gd iconv imap jpeg mysql mysqli nls pdo pcre pear posix postgres session ssl tiff truetype unicode xml xsl zlib tidy json xmlrpc simplexml

```

It would seem that a PHP config file somewhere might be the key, or the obvious missing use flag or app.

----------

## malern

What is "sendmail_path" set to in your php.ini?

----------

## bungernut

 *malern wrote:*   

> What is "sendmail_path" set to in your php.ini?

 

It is not set, commented out, at least in "/etc/php/apache2-php5/php.ini"

I dont know if e107 or phpBB set it locally, but in their config they allow me to set smtp setting...

These are the options in e107

```

Emailing method

If unsure, leave as php    

SMTP Server:      

SMTP Username: (optional)      

SMTP Password: (optional)      

Keep SMTP session alive: 

Use 'POP before SMTP' authentication:  
```

This is the error when trying to use it:

 *Quote:*   

> The email could not be sent. Please review your SMTP settings, or disable SMTP and try again.

 

It may be that these programs are not compatible with gmail, one setting necessary in ssmtp is the following which isn't an option in either phpBB or e107:

```
UseSTARTTLS=YES
```

I will try and read more on php.ini

Remember my goal is to allow each user to setup smtp for themselves. Currently the server can send mail with sendmail, but that means all users will recieve e-mails from only one smtp account.

----------

## malern

 *bungernut wrote:*   

> Remember my goal is to allow each user to setup smtp for themselves. Currently the server can send mail with sendmail, but that means all users will recieve e-mails from only one smtp account.

 

Oh, I see, you want to use the custom SMTP functionality in e107/phpBB, rather than using the standard mail() function to send everything via ssmtp?

If gmail requires TLS, then e107 and phpBB will have to support TLS in their SMTP client implementations. I don't know about e107, but this post seems to indicate it's possible with phpBB

http://www.phpbb.com/community/viewtopic.php?f=64&t=527077

----------

## bungernut

Thanks so much, that ssl:// in the address was the key, at least for e107

setup SMTP as follows

```

SMTP Server: ssl://smtp.gmail.com:465

SMTP Username: (optional)  <your gmail address>@gmail.com

SMTP Password: (optional)  <your password>

```

----------

