WeBWorK Main Forum

Sending email through gmail with TLS

Re: Sending email through gmail with TLS

by Robert Mařík -
Number of replies: 1

Old question, but someone could be interested.

I have gmail account switched to less secure access.

smtp server is smt.gmail.com

To send emails I had to add username and password into the /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator.pm file.

In the lines following

sub createEmailSenderTransportSMTP {

I changed the setting into

host => $ce->{mail}->{smtpServer},
ssl => 'starttls', #$ce->{mail}->{tls_allowed}//0, ## turn off ssl security by default
port => $ce->{mail}->{smtpPort},
timeout => $ce->{mail}->{smtpTimeout},
sasl_username => 'myemail@gmail.com',
sasl_password => 'mypassword',

Here of course you have to use your username and password.

According tom some Debian Howto, 100 email per day is the limit for this access to the smtp server. The reply-to is to not the student's email, but the gmail used for sending messages. This has been mentioned in some other threads.

Hope this helps someone.


In reply to Robert Mařík

Re: Sending email through gmail with TLS

by Bernd Sing -

Hi Robert,

thanks, I did help me at the time.

I would like to mention, though, that now after upgrading to 2.18 sub createEmailSenderTransportSMTP is no longer found in the file /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator.pm, but in the file /opt/webwork/webwork2/lib/WeBWorK/Utils.pm.

Hope that helps someone else.