<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:0 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:inherit;
        panose-1:0 0 0 0 0 0 0 0 0 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML con formato previo Car";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
span.EstiloCorreo17
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.HTMLconformatoprevioCar
        {mso-style-name:"HTML con formato previo Car";
        mso-style-priority:99;
        mso-style-link:"HTML con formato previo";
        font-family:"Courier New";
        mso-fareast-language:ES-NI;}
span.apple-converted-space
        {mso-style-name:apple-converted-space;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 3.0cm 70.85pt 3.0cm;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="ES-NI" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:&quot;Arial&quot;,sans-serif">Good Afternoon,
<br>
<span style="color:#212121;background:white">I modified the Email.pm file to send mail through an account in gmail .<o:p></o:p></span></span></p>
<p class="MsoNormal" style="background:white"><span lang="EN" style="font-size:14.0pt;font-family:&quot;Arial&quot;,sans-serif;color:#212121;mso-fareast-language:ES-NI">The modified code is as follows:<o:p></o:p></span></p>
<p class="MsoNormal" style="background:white"><span lang="EN" style="font-size:14.0pt;font-family:&quot;Arial&quot;,sans-serif;color:#212121;mso-fareast-language:ES-NI"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="background:white"><span lang="EN-US" style="font-size:10.5pt;font-family:&quot;Arial&quot;,sans-serif;color:#333333;background:white">sub send_mail_via_smtp</span><span lang="EN-US" style="font-size:10.5pt;font-family:&quot;Arial&quot;,sans-serif;color:#333333"><br>
<span style="background:white">{</span><br>
<span style="background:white">&nbsp;&nbsp;&nbsp; my( %p ) = @_;</span><br>
<br>
<span style="background:white">&nbsp;&nbsp;&nbsp; eval 'use Net::SMTP::TLS';</span><br>
<br>
<span style="background:white">&nbsp;&nbsp;&nbsp; my $repository = $p{session}-&gt;get_repository;</span><br>
<br>
<span style="background:white">&nbsp;&nbsp;&nbsp; my $smtphost = $repository-&gt;get_conf( 'smtp_server' );</span><br>
<span style="background:white">&nbsp;&nbsp;&nbsp; ##my $smtphost = 'smtp.gmail.com';</span><br>
<br>
<span style="background:white">&nbsp;&nbsp;&nbsp; if( !defined $smtphost )</span><br>
<span style="background:white">&nbsp;&nbsp;&nbsp; {</span><br>
<span style="background:white">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $repository-&gt;log( &quot;No STMP host has been defined. To fix this, find the full\naddress of your SMTP server (eg. smtp.example.com) and add it\nas the value of smtp_server in\nperl_lib/EPrints/SystemSettings.pm&quot; );</span><br>
<span style="background:white">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return( 0 );</span><br>
<span style="background:white">&nbsp;&nbsp;&nbsp; }</span><br>
<br>
<br>
<span style="background:white">&nbsp;&nbsp;&nbsp; my $smtp = new Net::SMTP::TLS (</span><br>
<span style="background:white">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $smtphost,</span><br>
<span style="background:white">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Hello&nbsp;&nbsp; =&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'eprints-server.on-linux.org',</span><br>
<span style="background:white">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Port&nbsp;&nbsp;&nbsp; =&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 587,</span><br>
<span style="background:white">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; User&nbsp;&nbsp;&nbsp; =&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'eprints-server@gmail.com',</span><br>
<span style="background:white">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Password=&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'gmail_password',</span><br>
<span style="background:white">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; );</span><br>
<br>
<span style="background:white">&nbsp;&nbsp;&nbsp; # my $smtp = Net::SMTP-&gt;new( $smtphost);</span><br>
<br>
<span style="background:white">&nbsp;&nbsp;&nbsp; if( !defined $smtp )</span><br>
<span style="background:white">&nbsp;&nbsp;&nbsp; {</span><br>
<span style="background:white">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $repository-&gt;log( &quot;Failed to create smtp connection to $smtphost&quot; );</span><br>
<span style="background:white">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return( 0 );</span><br>
<span style="background:white">&nbsp;&nbsp;&nbsp; }</span><br>
<br>
<span style="background:white">&nbsp;&nbsp;&nbsp; $smtp-&gt;mail( $p{from_email} );</span><br>
<span style="background:white">&nbsp;&nbsp;&nbsp; $smtp-&gt;to( $p{to_email} );</span><br>
<span style="background:white">&nbsp;&nbsp;&nbsp;<span class="apple-converted-space">&nbsp;</span></span><br>
<span style="background:white">&nbsp;&nbsp;&nbsp; # if( !$smtp-&gt;recipient( $p{to_email} ) )&nbsp;&nbsp;&nbsp;<span class="apple-converted-space">&nbsp;</span></span><br>
<span style="background:white">&nbsp;&nbsp;&nbsp; # {</span><br>
<span style="background:white">&nbsp;&nbsp;&nbsp; #&nbsp;&nbsp;&nbsp; $repository-&gt;log( &quot;smtp server refused &lt;$p{to_email}&gt;&quot; );</span><br>
<span style="background:white">&nbsp;&nbsp;&nbsp; #&nbsp;&nbsp;&nbsp; $smtp-&gt;quit;</span><br>
<span style="background:white">&nbsp;&nbsp;&nbsp; #&nbsp;&nbsp;&nbsp; return 0;</span><br>
<span style="background:white">&nbsp;&nbsp;&nbsp; # }</span><br>
<br>
<span style="background:white">&nbsp;&nbsp;&nbsp; my $message = build_email( %p );</span><br>
<span style="background:white">&nbsp;&nbsp;&nbsp; my $data = $message-&gt;as_string;</span><br>
<span style="background:white">&nbsp;&nbsp;&nbsp; # Send the message as bytes, to avoid Net::Cmd wide-character warnings</span><br>
<span style="background:white">&nbsp;&nbsp;&nbsp; utf8::encode($data);</span><br>
<span style="background:white">&nbsp;&nbsp;&nbsp; $smtp-&gt;data;</span><br>
<span style="background:white">&nbsp;&nbsp;&nbsp; $smtp-&gt;datasend( $data );</span><br>
<span style="background:white">&nbsp;&nbsp;&nbsp; $smtp-&gt;dataend;</span><br>
<span style="background:white">&nbsp;&nbsp;&nbsp; $smtp-&gt;quit;</span><br>
<br>
<span style="background:white">&nbsp;&nbsp;&nbsp; return 1;</span><br>
<span style="background:white">}<o:p></o:p></span></span></p>
<p class="MsoNormal" style="background:white"><span lang="EN-US" style="font-size:10.5pt;font-family:&quot;Arial&quot;,sans-serif;color:#333333;background:white"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="background:white"><span lang="EN-US" style="font-size:10.5pt;font-family:&quot;Arial&quot;,sans-serif;color:#333333;background:white"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="background:white"><span lang="EN-US" style="font-family:&quot;Arial&quot;,sans-serif;color:#333333;background:white"><o:p>&nbsp;</o:p></span></p>
<pre style="background:white"><span lang="EN" style="font-size:11.0pt;font-family:&quot;Arial&quot;,sans-serif;color:#212121">But when sending mail, displays the following error:</span><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Arial&quot;,sans-serif;color:#212121"><o:p></o:p></span></pre>
<pre><span lang="EN-US" style="color:black">Can't locate object method &quot;new&quot; via package &quot;Net::SMTP::TLS&quot; (perhaps you forgot to load &quot;Net::SMTP::TLS&quot;?) at /usr/share/eprints3/perl_lib/EPrints/Email.pm line 163.<o:p></o:p></span></pre>
<pre><span lang="EN-US" style="color:black"><o:p>&nbsp;</o:p></span></pre>
<pre style="background:white"><span lang="EN" style="font-family:&quot;Arial&quot;,sans-serif;color:#212121">How do I correct this error ?<o:p></o:p></span></pre>
<pre style="background:white"><span lang="EN" style="font-family:&quot;Arial&quot;,sans-serif;color:#212121"><o:p>&nbsp;</o:p></span></pre>
<pre style="background:white"><span lang="EN" style="font-family:&quot;inherit&quot;,serif;color:#212121">How do I get to send mail through an account in gmail ?</span><span lang="EN-US" style="font-family:&quot;inherit&quot;,serif;color:#212121"><o:p></o:p></span></pre>
<pre style="background:white"><span lang="EN-US" style="font-family:&quot;Arial&quot;,sans-serif;color:#212121"><o:p>&nbsp;</o:p></span></pre>
<pre style="background:white"><span lang="EN-US" style="font-family:&quot;Arial&quot;,sans-serif;color:#212121"><o:p>&nbsp;</o:p></span></pre>
<pre style="background:white"><span lang="EN" style="font-family:&quot;inherit&quot;,serif;color:#212121">Thank you</span><span style="font-family:&quot;inherit&quot;,serif;color:#212121"><o:p></o:p></span></pre>
<pre style="background:white"><span lang="EN-US" style="font-family:&quot;Arial&quot;,sans-serif;color:#212121"><o:p>&nbsp;</o:p></span></pre>
<pre style="background:white"><span lang="EN-US" style="font-family:&quot;Arial&quot;,sans-serif;color:#212121"><o:p>&nbsp;</o:p></span></pre>
<pre><span lang="EN-US" style="color:black"><o:p>&nbsp;</o:p></span></pre>
<p class="MsoNormal" style="background:white"><span lang="EN-US" style="font-size:14.0pt;font-family:&quot;Arial&quot;,sans-serif;color:#212121;mso-fareast-language:ES-NI"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p>&nbsp;</o:p></span></p>
</div>
</body>
</html>