WeBWorK Main Forum

Sending email through gmail with TLS

Re: Sending email through gmail with TLS

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

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.

Robert