Change Cakephp Email Sender name - email

I'm using Gmail smtp in Cakephp to send emails.
And I wanna make the sender as what i defined.
I've tried
$email->from(['test#gmail.com' => '通知用メールサービス'])
and
$email->sender('app#example.com', '通知用メールサービス')
but none of it worked.
So is it impossible to change or i did something wrong?Thank you
sorry for my poor English.

Related

TYPOP3 powermail: why email to receivers is not send?

I have a TYPO3 website v10 and using powermail forms.
The test mail in installtool is send good.
The mail to user is send good.
The mail to receivers is not send. This is very strange.
Here is my settings from localconf file:
'defaultMailFromAddress' => 'contact#company.gmbh',
'defaultMailFromName' => 'contact#company.gmbh',
'defaultMailReplyToAddress' => 'contact#company.gmbh',
'defaultMailReplyToName' => 'contact#company.gmbh',
'transport' => 'smtp',
'transport_sendmail_command' => '/usr/sbin/sendmail -t -i',
'transport_smtp_encrypt' => false,
'transport_smtp_password' => '123456789123456',
'transport_smtp_server' => 'smtp.office365.com',
'transport_smtp_username' => 'admin#company.gmbh',
Can you please give me some idea why is the email to receivers never works?
Things you should check:
what is the sender address of the mail which is sent to the receiver? You should avoid to use the email address from the form data as sender address because most mail servers check SPF records nowadays. Better use TypoScript to set a static sender address like info#company.gmbh or no-reply#company.gmbh. To increase comfort for the receiver you could set a reply-to address. See here for details how to do that.
is the subject really set? If it's empty no mail is sent.
To track problems further I suggest to use a local development environment like DDEV which provides Mailhog out of the box to intercept all mails which are sent from the webserver. This helps a lot to test mails.
If your receiver mail is sent as Bcc: you might have hit an incompatibility of symfony/mailer (which TYPO3 uses from v10+) used with sendmail -i -t (symfony/mailer issue).
You can work around it by using transport_sendmail_command = /usr/sbin/sendmail -bs.
This TYPO3 issue explains it, too.

Powermail doesn't send mail

I have installed powermail extension 4.4 on typo3 v7.6 project, the test mail is sending good, but when I fill the form on frontend and click submit, no e-mail is delivered/arrives.
I configured the form in backend with name, e-mail, and subject for both receiver and sender.
I have used different e-mail addresses too.
I have also tried to disable the spamshield from typoscript : spamshield._enable = 0.
I have added a defaultEmailAdress in the installtool config : [MAIL][defaultMailFromAddress] .
Does anybody have another idea?
Whats in your LocalConfiguration.php ?
'MAIL' => [
'transport' => 'sendmail',
'transport_sendmail_command' => '/usr/sbin/sendmail -t -i ',
should mostly work fine. But maybe you need to change transport to smtp or something else?
What really works good for me is the setup with Mailhog, to try Emails in Development.
I have fixed that, the problem was that i have used an different email adress in the plugin different from the adress in the smtp setting of installtool, this is was wrong, i have to use the same adress.

Email Doesn't Send(Type safe plugin for email ;version:Play 2.2.1 ,Scala 2.10.2)

I am not sure whether this piece of code should send email to an email address or not or just Mock emailer which just prints values .Can anyone tell me what I am doing wrong?
I took help from here:
https://github.com/typesafehub/play-plugins/tree/master/mailer
I am not getting any error...But didn't get anything when I check email...
application.scala
val mail = use[MailerPlugin].email
mail.setSubject("MailAPage email")
mail.setRecipient("Dummy Recipient <a.....#gmail.com>")
mail.setFrom("Six Hats <shat...#gmail.com>")
//or use a list
mail.setBcc(List("Dummy1 <d...#gmail.com>", "dummy2 <m....#gmail.com>"): _*)
//sends html
mail.sendHtml("<html>html</html>")
//sends text/text
mail.send("text")
//sends both text and html
mail.send("text", "<html>html</html>")
Should I have to do anything else ?
You would expect an exception if you can't connect to the mail server. For instance in case hostname or port is incorrectly configured.
If you are able to connect to the mail server/agent then all the errors that will happen there most probably will not reach your code.
For example if you run postfix or sendmail on localhost 25. You can connect to it and tell it to send the mail but you would not know if it did it.
It could be that your ISP is blocking outgoing SMTP traffic, and things like that. Do you use any particular mail server like gmail or the one provided by your ISP?

Emails sent through joomla go to SPAM folder

I am using the latest Joomla build for my website.
Allso we use a DNS record for having the mail delivered to our own server instead of the server on which the website is hosted.
I have used several contact form components, but every sent mail goes to my SPAM folder.
After searching hours on the web (and getting linked to this site frequently) i decided to make a new post.
It does not matter if i use the standard joomla forms, or any component.
Whenever a user fills in a form on my website, the email gets sent. The user receives a copy of its message, and i receive the message of the user. However, this message gets thrown in the spam folder, as phishing.
The sender of the mail always is: username#nameserver.i3d.net; namens; websitename
What do i have to change/enable/disable for this to work?
Thanks in advance.
Patrick.
(Sorry, I'm new to Joomla, but it uses PHP, so this may apply. Also this answer got a little long...)
It might be an issue with the email headers. A lot of email clients will automatically spam-box all mail where the address in the From: header doesn't match the envelope sender. As an analogy, you might not trust a snail-mail letter signed "Your Rich Uncle", mailed in an envelope with a Nigerian return address. Also if your envelope sender has a different domain than the one the email is actually sent from, that's another quick ticket to the junk bin. For more info about Gmail's message blocking policies (and general good practices), you can try this help page.
Here's some basic PHP email-sending code:
$to = $userEmailAddress;
$subj = $emailSubject;
$mesg = $emailMessage;
$headers = implode("\r\n",array(
"MIME-Version: 1.0"
,"Content-type: text/html;charset=iso-8859-1"
,"From: WEB_ADMIN_NICE_NAME <WEB_ADMIN#YOURSERVER.COM>" // *** 'From:' header
));
$from = "-fWEB_ADMIN#YOURSERVER.COM"; // *** envelope sender
if(!mail($to, $subj, $text, $headers, $from)){
//Some error handling...
}
On the first line I commented, you'll want to replace WEB_ADMIN_NICE_NAME with the name you want the email recipient to see (e.g. "Bill Gates"), and on both lines, replace WEB_ADMIN#YOURSERVER.COM with the actual return address (e.g. "da_boss#microsoft.com"). Note: whatever address you choose for the return address is where users' replies will be sent.
To reiterate, make sure both lines have the same return address (though the nice name can be anything you like), and make sure that the actual server sending the mail is in fact located at YOURSERVER.COM.
Lastly, I'm not sure where Joomla does its mailing, but if you're totally lost, you can try grepping with -lr for 'mail[[:space:]]*('.
there are several reasons that could make your email look suspicious to spam filters; to find out which head on to:
http://www.mail-tester.com
grab the email address and send an email from your website to it.
Then go back to the page and it will tell you what's wrong.
btw I'm struggling with the same issue,my problem being that on Joomla 2.5.9 apparently when you send html emails, a text-only copy is not added to the message, which is considered "spammish behaviour"
The problem is the i3d.net email address. My personal experience is that their network (31.204.154.0 - 31.204.155.255) is a significant source of spam and they do not action abuse reports. I suggest changing your hosting company.

email not proper in rails 3

I've same problem like here. But still not able to solve it.
I've followed steps from here. but doing so doesn't sends mail.
The log file says: Mail is sent. but at the other side mail is not received.
Any ideas why?
Check your SMTP settings and make sure you have defined the right settings for your e-mail host. If you are using a sender e-mail other than Gmail then your settings will be different to the ones used in the Railscast.
The file to check is here: config/initializers/setup_mail.rb.
Edit: It still may be possible that the settings you used in jsp may not match perfectly with the 'phrasing' that Rails expects in the setup_mail.rb file. I have frequently come up against this problem where a slight difference in what SMTP settings you mention / don't mention / how they are worded will determine whether the e-mails send/receive or not.
If your logs show the e-mail is sending to a valid e-mail address (and you are not receiving those e-mails in your inbox or spam filter) then the problem, as far as I know, is most likely to be your SMTP. My advice is to check online for the Rails-specific SMTP settings for your e-mail provider, or in the case that you cannot find them, try different combinations until you find the correct one.
Okay the problem is solved. Problem was my file corresponding to action was not at proper place. Here is quick view on how to do it:
Add following to actionmailer:-
def send_mail
attachments['1.pdf'] = File.read('c:/1.pdf')
mail(:to => "harsh#xyz.com", :subject => "xyz", :from=>"harsh#xyz.com")
mail.deliver
end
Notes:- Make sure that the smtp settings are correct and the file corresponding to the action (In this example send_mail.rhtml) is present under appropriate folder.