How to send mail via smtp using ssl in php - ssl

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.

Related

iRedMail messages missing DKIM header

I setup a clean iRedMail installation on a new server.
I followed the instructions here:
https://docs.iredmail.org/install.iredmail.on.debian.ubuntu.html
and then setup the dns records like so:
https://docs.iredmail.org/setup.dns.html
I also added a certbot certificate: https://docs.iredmail.org/letsencrypt.html
I can now receive email from all other email providers and can send email to other users of my domain. But I cannot send email to other email providers, it doesn't even end up in the spam folder.
After some research i found out that my emails are missing a dkim signature which is the most likely reason they aren't picked up by other servers.
I did the amavisd-new testkeys test and passed, although I'm pretty sure it doesn't work, since it also works if I don't setup any DNS records.
So my questions are:
shouldn't my emails be DKIM signed for some reason?
which service is responsible for adding DKIM headers to emails?
Where can I find out why it doesn't sign my mails?
Turns out Amazon blocks outgoing traffic on port 15 by default. Took me a while to figure out. There was no problem with DKIM.

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.

How to send a mail to all the domains without configuring mail server

I need to send a mail to any domains(gmail,yahoo) without configuring any mail servers in environment.rb.
Is it possible? if it's NO the how devise_invitable gem is allowing us to trigger the mail?
You can use third party email services like:
http://sendgrid.com/
http://www.mailgun.com/
http://aws.amazon.com/ses/
Though you will still need to specify those in environment files, just that you won't need to manage an email server.

Using Axis EmailWS-1.6 to send an HTML email

I am currently limited to the usage of Tomcat with Axis2 and its EmailWS-1.6 webservice to send an email. This has to be an HTML mail.
This is the configuration of EmailWS.properties
Email Service Configuration
(This configuration requires EmailWS-1.6 or later)
contentType=text/html;charset=utf-8
returnAddress=
mail.transport.protocol=smtp
mail.host=
mail.smtp.port=465
mail.smtp.auth=true
mail.smtp.socketFactory.port=465
mail.smtp.socketFactory.class=javax.net.ssl.SSLSocketFactory
mail.smtp.socketFactory.fallback=false
mail.smtp.starttls.enable=true
mail.smtp.quitwait=false
authUsername=
authPassword=
I can succesfully send an email, but it seems to arrive as plain text. The email client does not translate it to HTML. What is the proper configuration of Tomcat/Axis2 to do this?
Tomcat Axis2 Email webservices also contains an operation which enables you to send an xml-based email message. By using this operation, I was able to send the HTML email. It was also received as HTML.

Get SMTP automatically

I am using code to send email through SMTP that is given manually. I wish that user does not have to give the SMTP. My application should get SMTP automatically and use that.
Can I know what is the SMTP of the current ISP, with which my client is connected?
Thanks
Furqan
You could try to read that from the user's e-mail clients; AFAIK each e-mail client (e.g. Outlook, Thunderbird, Opera, Eudora) stores the SMTP server settings differently; so probably look for the most common ones (Thunderbird, Outlook, ?). Also, some people only use web-based e-mail (esp. gMail users), so they may not even have a SMTP setting stored anywhere.
Note: nosing around in other apps' settings can be seen as borderline spyware, so I suggest to get permission from the user before you start digging in their app settings.
No, I don't think this is possible. What you could try is to look if the SMTP server is configured in an other program. E.g. under Windows in Windows Mail. However, I don't know if it's worth the trouble. Today SMTP auth is common and probably no other program gives you access to the users credentials so you have to ask the user in all cases.