Unable to send and receive email after domain name change

Hi,@ctgraham

Under your suggestion, I saw this thread, to understand some of the SPF and DKIM related information, I test to my state of SPF,

v = spf1 include:spf.sinamail.sina.com.cn - all

, it may be refused to all the domains under the mail, I don’t know why, I modify the code as the thread, but I am using SMTP, patch is still valid, I’m a little overwhelmed, or I need somewhere to add Spf records, add after the need to modify the code

SPF is almost certainly not the issue with your SMTP connection failing. SPF should not allow or prevent the SMTP connection.

Also, configuring SPF is a bit outside of the scope of this forum, you’d be better off checking with your hosting provider for details there.

With those disclaimers, I can say that the SPF record you’ve provided says:

I think your next steps are either:

  • Modify the code to add your hosting provider’s custom mail API/SDK
  • Ask your hosting provide for SMTP configuration without their API/SDK
  • Try another hosting provider with support for PHP mail() or SMTP

Hello,@ctgraham,I want to change the host server,this is configuration:do
Does it ok?maybe I should choose Linux

The resources your server needs are going to depend on the expected traffic for your journal or journals, so I can’t really answer that question. I can suggest this: The typically OJS installation does not require many resources, and (for most users) a standard shared hosting plan should work fine. For higher traffic journals or multijournal installations, a mid-tier VPS would be preferred.

I‘m so sorry that I borther you again,now I can support the mail function, but need to use the plugin of sendmail, so I installed the plugin, but still did not solve the problem, the error has always been to refuse to connect, I did not get useful help on the Internet, had to come to you, I hope you can help me.
This is debug.log of sendmail:

18/11/07 20:04:13 ** ager
18/11/07 20:04:13 ** http://localhost/ojs/index.php/astp
18/11/07 20:04:13 ** — MESSAGE END —
18/11/07 20:04:13 ** Connecting to mail.126.com:465
18/11/07 20:04:15 ** Disconnected.
18/11/07 20:04:15 ** Disconnected.
18/11/07 20:04:15 ** Disconnected.
18/11/07 20:04:15 ** Socket Error # 10061Connection refused.

This is sendmail.ini:

; configuration for fake sendmail

; if this file doesn’t exist, sendmail.exe will look for the settings in
; the registry, under HKLM\Software\Sendmail

[sendmail]

; you must change mail.mydomain.com to your smtp server,
; or to IIS’s “pickup” directory. (generally C:\Inetpub\mailroot\Pickup)
; emails delivered via IIS’s pickup directory cause sendmail to
; run quicker, but you won’t get error messages back to the calling
; application.

smtp_server=mail.126.com

; smtp port (normally 25)

smtp_port=465

; SMTPS (SSL) support
auto = use SSL for port 465, otherwise try to use TLS
; ssl = alway use SSL
; tls = always use TLS
; none = never try to use SSL

smtp_ssl=auto

; the default domain for this server will be read from the registry
; this will be appended to email addresses when one isn’t provided
; if you want to override the value in the registry, uncomment and modify

;default_domain=mydomain.com

; log smtp errors to error.log (defaults to same directory as sendmail.exe)
; uncomment to enable logging

error_logfile=error.log

; create debug log as debug.log (defaults to same directory as sendmail.exe)
; uncomment to enable debugging

debug_logfile=debug.log

; if your smtp server requires authentication, modify the following two lines

auth_username=xxxxxxx@126.com
auth_password=xxxxxxx

; if your smtp server uses pop3 before smtp authentication, modify the
; following three lines. do not enable unless it is required.

pop3_server=
pop3_username=
pop3_password=

; force the sender to always be the following email address
; this will only affect the “MAIL FROM” command, it won’t modify
; the "From: " header of the message content

force_sender=xxxxxxx@126.com

; force the sender to always be the following email address
; this will only affect the “RCTP TO” command, it won’t modify
; the "To: " header of the message content

force_recipient=

; sendmail will use your hostname and your default_domain in the ehlo/helo
; smtp greeting. you can manually set the ehlo/helo name if required

hostname=localhost

This is php.ini:

[mail function]
; For Win32 only.
; http://php.net/smtp
;SMTP = localhost
; http://php.net/smtp-port
;smtp_port = 25

; For Win32 only.
; http://php.net/sendmail-from
;sendmail_from =“admin@wampserver.invalid”

; For Unix only. You may supply arguments as well (default: “sendmail -t -i”).
; http://php.net/sendmail-path
sendmail_path =“d:/wamp/www/ojs/sendmail -t -i”

; Force the addition of the specified parameters to be passed as extra parameters
; to the sendmail binary. These parameters will always replace the value of
; the 5th parameter to mail().
;mail.force_extra_parameters =

; Add X-PHP-Originating-Script: that will include uid of the script followed by the filename
mail.add_x_header = On

; The path to a log file that will log all mail() calls. Log entries include
; the full path of the script, line number, To address and headers.
;mail.log =
; Log mail to syslog (Event Log on Windows).
;mail.log = syslog

These are all related config,please .
Thank you ,ctgraham

Sorry, this is really a server administration question, not an OJS question. We can’t provide much guidance there.

OJS supports either the native PHP mail() function or an SMTP connection. In your description it sounds like you are reconfiguring PHP’s mail() function to use a local install of sendmail. This may work, but it is out of scope for this forum.

I will note that you appear to be using Windows (WAMP) paths in your php.ini sendmail_path, which is commented as “For Unix only”. Again, this may work, but the specifics of this configuration would be better suited to conversation with your hosting provider or another forum.

If so, that’s too bad. Could you please tell me what environment you were using at the time of development? In addition, would you please help me solve the problem of another thread?
It is Statistics haven't changed and load
I’m very sorry for the delay. I need to solve the counting problem in the last few days。
Thank you ,my friend

Contributors’ development environments are pretty varied, but most development and deployments (to my knowledge) are done in a Linux stack with Apache and mysql or mariadb. I don’t have a good sense of how many sites are using PHP mail() vs. SMTP, but certainly both are used in development and production. You can see the breadth of system requirements for 2.4.x here:

@ctgraham,After all this time, in recent months I’ve been trying to figure out what works best for a domestic server, but to no avail.In the way of sending mail, I chose the SMTP function, I considered that SMTP is a protocol of mail, why became email function, or is just the same name, my shallow knowledge causes that I don’t know what’s the relationship between the two.At present, email can only be sent by the person, whose email must be the same as SMTP email configuration in the mailbox. In the process of seeking solutions I encountered the problem of port, our domestic server is no longer allow the user to use port 25, but 465 and other more stringent security port, if I use mail function to send mail,does that make any difference?

Ultimately everything sent from your server is routed through SMTP. Your server likely has a server-to-server SMTP connection, and the PHP mail() function makes use of that. If you do not want to use your server’s SMTP configuration, or if you cannot use your server’s SMTP configuration (via PHP mail()), you can choose to provide alternate SMTP settings in config.inc.php. This allows the OJS application to connect directly to an arbitrary SMTP server, bypassing your server’s configuration.

Thank you very much for the long time help, I have to say it to you. Two months ago, I had solved the email problems .