Prestashop PHP mail not working - prestashop

I was looking for a solution here without a luck. I can't send mails from my prestashop using mail() function. I've tested with my own .php file and it works flawlessly, but in presta receive just an error.
I've looked up that my phpinfo has empty "from" value, but I don't know if that's an issue.
What can be the solution? I know that Presta is using swiftmail.

Did you try sending email in Advanced Preferences -> Mail -> Sent a test message (bottom of page)?
Whether the script / module that sending emails, as he does the translations necessary (eg if you send email in Italian, must emails to be translated into Italian).
Regards

To send email from Prestashop, you have to configure SMTP by clicking on
Advanced Preferences -> E-Mail.
A form will be open where you have to enter this :
Server: smtp.gmail.com (if you uses gmail)
Username: your gmail id
Password: your gmail password
Encryption: SSL
Port: 465
Then, write code in PHP to send mail using send() function of class MailCore.php

Related

Gmail sending problems

So i try smtplib to send gmail automatically, however it fail because of a error, after some checking, my username and pass are True. So i want to ask if there were any mistakes that can lead to this error.
Here is my code, the port is 465 and i don't want anyone know my pass and my username.
The error message "username and password not accepted" is the standard error message you get from the smtp server when sending the users actual google password.
This method of authentication is not acceptable by the SMTP server after (May 30, 2022). Partially due to the removal of Less secure apps & your Google Account mostly because client login is not considered to be secure.
Your options are to to enable 2fa on our google account and use and create an apps password. Simply use it in place of the password in your code.
smtp.login(username, appsPasswrod)
Or to use XOauth2 and authenticate the application.
Create a sendEmail() function, which will help to send emails to one or more than one recipient by calling the function.
def sendEmail(to, content):
server = smtplib.SMTP('smtp.gmail.com', 587)
server.ehlo()
server.starttls()
server.login('youremail#gmail.com', 'your-password')
server.sendmail('youremail#gmail.com', to, content)
server.close()
content = "Message to send"
to = "useremail#gmail.com"
sendEmail(to, content)
NOTE: Do not forget to make sure that the smtplib requires 'enable the less secure apps' feature in your Gmail account. Otherwise, the sendEmail function will not work properly..
Create App Password: App Passwords

Roundcube rest api

is there any REST API for roundcube?
I have this need:
I developed a software where it sends some emails to clients and we need to save the sent mails in the "sent" folder.
I searched a lot and all tutorials say that I have to use the auto_bcc but I need to simulate the client's behavoiur, I mean, when the boss access the "automatic#domain.com" mailbox by using roundcube or another email client, he can see the sent folder and the sent mails (not in the inbox), so I was thinking that if I can connect to roundcube and simulate a mail sending, roundcube will save the mail in the sent folder.
I hope I have explained myself
Thanks
You not specify coding language ... in case you use php, use PHPmailer for send the emails.
PHPmailer use resident email server of your system to operate. This means PHPmailer and Roundcube use same standard (inbox/outbox) folders of each user.
Then simply send the email using phpmailer and the email shown in Sent folder !! Look this message shows as unread in Roundcube, you need to set up a filter inside Roundcube if you want to mark as read and/or move this emails to a specific folder.

Default reset password email not sent via Appcelerator backend, nor emails with a template, only email configuration changes are sent

When I execute the following code,
Cloud.Users.requestResetPassword({
email: myUsersEmailAddress
}, function (e) {
if (e.success) {
Ti.API.info('Success: Reset Request Sent ' + JSON.stringify(e));
} else {
Ti.API.error('Error:\n' + ((e.error && e.message) || JSON.stringify(e)));
}
});
I should receive an email to reset my password, as seen in the documentation:
GET users/request_reset_password.json Sends an email to a user
containing a link to recover a lost password. You can use the default
email template provided by ACS, or specify a custom email template
that you have created. When using a custom email template, the email
must contain a properly formatted URL, as explained in the template
method parameter documentation below.
When the alert pops up, I can see that there was a match and that an email should have been sent.
However, I do not receive an email, nor do I see anything in the logs of my email backend (which does receive an email when I adapt my email configuration on the appc backend, thus my email is correctly configured)
I don't have any email templates configured, but according to the documentation it should use appc's default reset password email.
Does anyone has an idea about what I am doing wrong, or does this indicate an issue with appc's documentation or backend?
UPDATE: I have another function which sends email using a self-defined email template. When I invoke this function, i receive the following event(between the {}):
[INFO] : Deactivation email sent. {"success":true,"error":false,"meta":{"status":"ok","code":200,"method_name":"emailFromTemplate"}}
However, nothing is seen on our smtp backend. The only things we do see (and which we receive in our mailbox) are the emails which are sent when you adapt your email configuration settings in Appcelerator's backend, eg.
Subject: Appcelerator Cloud Services SMTP Test
Appcelerator Logo Hi Peter,
Your SMTP settings have been updated successfully!
Onward,
The Appcelerator Platform Team
Thanks,
David
It turned out to be a configuration issue, which could only be discovered by doing some curl calls against the api. So a good advice, test your config with curl too, and don't rely on the emails which are sent after you made a configuration change!

How to send mail via smtp using ssl in php

How can I send mail via smtp using ssl? We are able to send the simple text mail, but it's not allowing the links or certain tags in the mail to pass, we tried using pear-mail.
Please suggest any options.
We are using third party GMAIL and hosting is in Godaddy. All mx record are fine and earlier we were able to deviver mails when we have not used ssl, also as i mentioned we are able to send the simple text mails with ssl, so please no answers regarding hostings, just any options how to use it with ssl.
You might want to look at phpmailer. You can use phpmailer to send outgoing messages through gmail's SMTP server (smtp.gmail.com), and it has options to connect to the SMTP server by SSL. phpmailer is very simple to setup - just a few PHP files to copy to your server. See https://github.com/PHPMailer/PHPMailer. You can start sending mail using the simple example at the github page above as a boilerplate.

Incoming messages send again by openerp

When someone sends an email message, it can view on openerp inbox but the outgoing email sends again thru the configuration email address I set up.. why is it so?
I'm using Openerp v7.0.. I used the Outgoing Mail Server in the Settings > Technical > Email > Outgoing Mail Servers.
When someone sends an email and openerp retrieved it, it sends again and again an email but by using the email address I configure.
Your question is not quite clear[1], but this sounds like the default and correct behavior. When an OpenERP user receives an external email message, they will by default receive a copy of the email at their own email address (configured in their user preferences).
Let's say someone replies to a CRM Lead assigned to me (by sending an email to info#mycompany.com, which is imported via the fetchmail module into my OpenERP server): I want to receive a copy of this message in my real inbox at myname#mycompany.com).
In OpenERP 7.0 this behavior can be controlled in the "Email Preferences" of the user profiles: you can choose to receive email notification about new comments and new external emails, or about new external emails only, or no notification whatsoever.
[1]: The following information would help: the version of OpenERP you're using, how the emails are being fed to OpenERP (fetchmail module, mail gateway script, something else...), what email addresses are being fed to OpenERP, what email is configured on the user profiles, etc.