OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



Problems with SMTP

Are you responsible for making OCS work -- installing, upgrading, migrating or troubleshooting? Do you think you've found a bug? Post in this forum.

Moderators: jmacgreg, michael, John

Forum rules
What to do if you have a technical problem with OCS:

1. Search the forum. You can do this from the Advanced Search Page or from our Google Custom Search, which will search the entire PKP site. If you are encountering an error, we especially recommend searching the forum for said error.

2. Check the FAQ to see if your question or error has already been resolved. Please note that this FAQ is OJS-centric, but most issues are applicable to both platforms.

3. Post a question, but please, only after trying the above two solutions. If it's a workflow or usability question you should probably post to the OCS Conference Support and Discussion subforum; if you have a development question, try the OCS Development subforum.

Problems with SMTP

Postby zhekkie » Tue Oct 23, 2007 12:26 pm

Hello folks,

I just installed OCS2 on my company's server and I'm testing it. SMTP server is located on a different machine, but when I try to submit something in the system, instead of getting an e-mail, here the message I get:

Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in ............\ocs\classes\core\String.inc.php on line 155

I don't know where is the SMTP specified as "localhost". I changed the settings in php.ini. The configuration file looks like this.

[email]
; Use SMTP for sending mail instead of mail()
; smtp = On

; SMTP server settings
; smtp_server = i've changed this
; smtp_port = 25

; Enable SMTP authentication
; Supported mechanisms: PLAIN, LOGIN, CRAM-MD5, and DIGEST-MD5
; smtp_auth = PLAIN - Can I somehow turn off authorization in SMTP???
; smtp_username = username
; smtp_password = password

; Allow envelope sender to be specified
; (may not be possible with some server configurations)
; allow_envelope_sender = Off

; Enable attachments in the various "Send Email" pages.
; (Disabling here will not disable attachments on features that
; require them, e.g. attachment-based reviews)
enable_attachments = On

Please help
zhekkie
 
Posts: 2
Joined: Tue Oct 23, 2007 12:07 pm

Re: Problems with SMTP

Postby asmecher » Tue Oct 23, 2007 12:52 pm

Hi zhekkie,

The ";" at the beginning of those configuration lines marks them as comments -- remove the ";" before "smtp = On" etc. Otherwise, you can configure PHP's own SMTP functions in your system's php.ini. (Those, IIRC, are only available for Windows platforms.)

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 9214
Joined: Wed Aug 10, 2005 12:56 pm

Re: Problems with SMTP

Postby zhekkie » Tue Oct 23, 2007 1:13 pm

Wow, that was easy.... :D

Thanks
zhekkie
 
Posts: 2
Joined: Tue Oct 23, 2007 12:07 pm

Re: Problems with SMTP

Postby makos » Mon Jun 16, 2008 2:02 pm

I have a similar problem as zhekkie; when a user try to register, the system show this message:

Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in D:\Archivos de programa\Apache Software Foundation\Apache2.2\htdocs\ocs2\classes\core\String.inc.php on line 155

After pushing the "Registration" button; as well as a new page is redirected that reports about the registration process.
I've seen the php configuration of the server and it seems to be ok; the php.ini file has no ";" at the beginning of the lines where the port and mailserver values are assigned but in the file isn't any "smtp=on" or ";smtp=on" line; I suppose that I need a specific email module in my server but I don't know... :oops:

Lots of thanks.

Marcos
makos
 
Posts: 30
Joined: Sat Dec 08, 2007 1:58 pm

Re: Problems with SMTP

Postby jmacgreg » Tue Jun 17, 2008 4:03 pm

Hi Marcos,

Actually, I'll jump in here and ask a few questions before one of the developers gets back to you --

Judging from our earlier conversation today, you are running this as a test case on your local (desktop) machine, correct? As a caveat, mail may not function as you would expect from local machines: you need to have a mail server set up to properly talk to the rest of the internet. Most of the time, you won't want to send mail from your home machine anyway, and our software will act more or less like mail is being sent out.

What do you have in your OCS install's config.inc.php under Email Settings? Are all lines referencing SMTP commented out?

Cheers,
James
jmacgreg
 
Posts: 4190
Joined: Tue Feb 14, 2006 10:50 am

Re: Problems with SMTP

Postby makos » Wed Jun 18, 2008 6:49 am

Hi James,

I'm using OCS on my local machine because I'm using it for my final university project and I hope that the whole system will work locally.
Can OCS work fully in a local machine??

In any case I've seen the config.inc.php file and all the lines referencing SMTP are commented (with ";") except "enable_attachments = On"
Must I change any line/setting??

Thanks.

Marcos
makos
 
Posts: 30
Joined: Sat Dec 08, 2007 1:58 pm

Re: Problems with SMTP

Postby smiri » Sat Jun 21, 2008 6:06 pm

Hi Marcos,

in the config.inc.php file, you will need to set all the correct SMTP settings under "Email Settings" section and make sure you remove any ";" at the beginning any line that you change. Every line that has ";" in the beginning, will not be looked at by the OCS software.

Regards,
smiri
 
Posts: 183
Joined: Thu Sep 06, 2007 7:01 pm

Re: Problems with SMTP

Postby makos » Mon Jun 23, 2008 11:03 am

Hi Siavish

I've the next configuration in the config.inc.php:

; Use SMTP for sending mail instead of mail()
smtp = On

; SMTP server settings
smtp_server = correo.scouts-es.org
smtp_port = 25

; Enable SMTP authentication
; Supported mechanisms: PLAIN, LOGIN, CRAM-MD5, and DIGEST-MD5
smtp_auth = LOGIN
smtp_username = myuser
smtp_password = mypass

; Allow envelope sender to be specified
; (may not be possible with some server configurations)
allow_envelope_sender = Off

; Enable attachments in the various "Send Email" pages.
; (Disabling here will not disable attachments on features that
; require them, e.g. attachment-based reviews)
enable_attachments = On

but No email were sent to the users when they are registered in the system and when They try to register to a specific conference, the system shows this message:
Warning: fsockopen() [function.fsockopen]: unable to connect to correo.scouts-es.org:25 in D:\Archivos de programa\Apache Software Foundation\Apache2.2\htdocs\ocs2\classes\mail\SMTPMailer.inc.php on line 163

I don't know what to do and I'm really in a mess :cry:

Thanks

Marcos
makos
 
Posts: 30
Joined: Sat Dec 08, 2007 1:58 pm

Re: Problems with SMTP

Postby smiri » Tue Jun 24, 2008 11:19 pm

Hi Marcos,

according to the error message you're getting, the software cannot connect to your smtp server. You should double check your smtp settings and make sure you have access to use it.

Regards,
smiri
 
Posts: 183
Joined: Thu Sep 06, 2007 7:01 pm

Re: Problems with SMTP

Postby makos » Tue Jun 24, 2008 11:49 pm

Hi Siavish,

What is "double check" my smtp settings and how can I do it??
By other way, do you know if the settings in the config.inc.php file are ok??
Needs OCS another SMTP setup that wasn't specified here??

Thanks

Marcos
makos
 
Posts: 30
Joined: Sat Dec 08, 2007 1:58 pm

Re: Problems with SMTP

Postby smiri » Wed Jun 25, 2008 10:17 am

Hi Marcos,

You could try commenting out the "smtp_auth =" line. So your config file should look like this:

; Enable SMTP authentication
; Supported mechanisms: PLAIN, LOGIN, CRAM-MD5, and DIGEST-MD5
; smtp_auth = LOGIN
smtp_username = myuser
smtp_password = mypass

Sometimes this is needed to send out emails using SMTP.

Regards,
smiri
 
Posts: 183
Joined: Thu Sep 06, 2007 7:01 pm

Re: Problems with SMTP

Postby makos » Wed Jun 25, 2008 3:55 pm

Hi Siavish,

I've tried that option and another different SMTP and the result is the same.
Moreover, I don't know why, but when I try to send an email to a user, clicking the envelope link, the email isn't deliveried but the system doesn't shows any warning message

Do you know what's going on??

Thanks and regards.

Marcos
makos
 
Posts: 30
Joined: Sat Dec 08, 2007 1:58 pm

Re: Problems with SMTP

Postby makos » Sat Jul 05, 2008 2:17 am

Hi,

I'm really desperate because I've tried differents alternatives and It doesn't work :cry: So I would like if Somebody could tell me how to hide the warning message because I must show a demo of the conference and I've decided not to show anything about the e-mails but there some proccess that try to send e-mail, like the registration phase, and then the warning message appears...

Thanks.

Marcos
makos
 
Posts: 30
Joined: Sat Dec 08, 2007 1:58 pm

Re: Problems with SMTP

Postby smiri » Sat Jul 05, 2008 11:43 am

Hi Marcos,

To not show the warning messages you can modify your php.ini file on your server and set "error_reporting = E_ERROR". Or you could change your index.php file in your OCS directory and add this line to the top of that page:

ini_set('error_reporting', E_ERROR);


Also, could you tell us what the warning message that you get is?

Regards,
smiri
 
Posts: 183
Joined: Thu Sep 06, 2007 7:01 pm

Re: Problems with SMTP

Postby makos » Sat Jul 05, 2008 12:43 pm

Hi Siavish,

Thanks for your reply and sorry about making you work on weekend... :oops:

The warning message is this:
Warning: fsockopen() [function.fsockopen]: unable to connect to mail.uah.es:25 in D:\Archivos de programa\Apache Software Foundation\Apache2.2\htdocs\ocs2\classes\mail\SMTPMailer.inc.php on line 163

I've contacted with my ISP and They've told me that they don't block any port; and then I've check my internet modem and I've enabled the 25 PORT; then I've tried to put the 4 different values of the smtp_auth var in the config.inc.php file (commenting the line included) but I don't know why but the system is still sending the warning message and then no e-mail is sent :? .

The only strange thing I've seen is that in my php.ini file I've the same smtp_server but the php_info (or similar :) ) function show "localhost" instead the server I've assigned on php.ini and I don't know where is "localhost" assigned... :shock:
makos
 
Posts: 30
Joined: Sat Dec 08, 2007 1:58 pm

Next

Return to OCS Technical Support

Who is online

Users browsing this forum: No registered users and 3 guests