i am currently developing a website which requires email verification, but i am developing on windows, and would like to test sending email verifications on localhost. I tried using Test Mail Server Tool, but i don't think i am setting it up correctly because there were no errors, but i didn't receive any email. this is the code i put in my config file
$config['mailtype'] = 'html';
$config['charset'] = 'utf-8';
$config['mailpath'] = 'C:\Program Files\Toolheap\Test Mail Server Tool\TestMailServerTool.exe';
$config['protocol']= 'smtp';
what am i doing wrong? i am really new to this so i have no idea where to start looking.
i created an email.php and put that in application/config/ so i don't think i need to initialize it?
thanks in advance.
Have you checked whether or not you need to include the following configuration options?
smtp_host
smtp_user
smtp_pass
smtp_port
Related
I am trying to send mails via smtp on my website, ( Symfony 5.2 ), but every time I try to use the built-in mailer bundle, I get the error :
Expected response code "250" but got code "530", with message "530 5.7.1 Authentication required".
I've tried sending mails using a php script, with the same smtp configuration, and it works everytime.
In my .env file :
MAILER_DSN=smtp://mail.infomaniak.com:587?encryption=tls&auth_mode=login&username=MY_USER_NAME&password=MY_PASSWORD
Any idea ?
Thanks !
According to this https://symfony.com/doc/current/mailer.html#transport-setup, the mailer dsn format should be.
MAILER_DSN=smtp://user:pass#smtp.example.com:port
And not
MAILER_DSN=smtp://mail.infomaniak.com:587?encryption=tls&auth_mode=login&username=user&password=pass
Notice how the user and password are specified. Might also worth mentioning that you might need to URL encode your password should it contain characters that need such an encoding.
Have you tried the format from the docs?
I have set up a Gerrit server and trying to make it send emails (for all events). But for some reason Gerrit doesn't send any emails. error_logs shows absolutely no data, that means it is not even trying to send emails.
Here is relevant part of my project.config for All-Projects:
[notify "demo"]
email = me#company.com
type = all
Here is my gerrit.config:
[gerrit]
basePath = git
canonicalWebUrl = http://hostname:8443/
[database]
type = h2
database = db/ReviewDB
connectionPool = true
poolLimit = 128
[index]
type = LUCENE
[auth]
type = LDAP
[ldap]
poolDebug = all
server = ldap://nod.company.com
accountBase = cn=users,dc=company,dc=com
accountEmailAddress = mail
referral = follow
[sendemail]
smtpServer = relay.company.com
smtpServerPort = 25
smtpUser = my_username
[container]
user = gerrit2
javaHome = /usr/lib/jvm/java-7-openjdk-amd64/jre
heapLimit = 2g
[sshd]
listenAddress = *:29419
maxConnectionPerUser = 256
[automerge]
botEmail = me#company.com
[download]
scheme = ssh
[httpd]
listenUrl = http://*:8443/
maxThreads = 128
[cache]
directory = cache
[gitweb]
cgi = /usr/share/gitweb/gitweb.cgi
Environment: Ubuntu 14.04 and Gerrit 2.11.6.
I have tried to send emails from command line on this server and that works just fine.
All of my individual projects on Gerrit inherit access rights from All-Projects. I even tried adding the email section to each individual project but that didn't help either.
My colleague, who has his own Gerrit server that is able to send emails, looked into my issue and couldn't figure out what's wrong with my server. We both have same Linux version, Gerrit version, gerrit.config and project.config.
Ok, found the issues and fixed them. I had two issues, sharing for user reference.
I installed sendmail utility when logged in as a user other than smtpUser account mentioned in gerrit.config. After that I forgot to add the sendmail utility to /opt and hence the smtpUser's account from gerrit.config was not able to access the sendmail utility. Once I shared the sendmail utility with all user accounts, gerrit started sending emails.
To summarize, make sure the user account mentioned under smtpUser has sendmail available to it. Thanks everyone for your time.
gerrit wont send the email ONLY to the user that is also the smtpUser in gerrit.config. I was testing it by sending emails to only me, and hence it didnt work. I had to change to project config to add an email address other than my own email account.
I dont know if this is a gerrit bug or a gerrit feature. If a feature then not sure what is the use case for this !!
I hope this info helps other guys out there.
I had this problem after a recent Gerrit update (from 2.15 -> 3.2).
I checked the postfix logs in /var/log/maillog and they clearly showed that after the machine was rebooted following the Gerrit update no more mails arrived here.
Looking further into <gerrit-path>/logs/error_log (I had to look in rollated files) showed me that there seemed to be a problem with our mail template and also gave me the path to the offending file.
We previously used a custom mail template from https://gist.github.com/orgads/d8a61a1c10efeb7a4fafbcb6374167c3, the format of which seems to no longer be valid. I replaced this with the .soy.example file provided by Gerrit which fixed the issue.
For me, since I was trying to test emails by getting them to send to my own email, I had to go to settings (Gerrit 2.15.17 BTW), then preferences, under email notifications, select "every comment" in the dropdown menu.
For the past few days I've been strugling with finding a way to send emails from my app. This is the sample code I am currently using. It think, by using this method, I might be unable to handle the situation of an improper setting of the mail accound of the computer my app will be running, so I thought about using a different method. I was wondering if is there any MessageUI equivalent for mac os. Is there any MessageUI equivalent for mac os. Any ideas?
There are two ways to do that:
AppleScript framework
NSSharingService
NSSharingService to compose mail:
let service = NSSharingService(named: NSSharingServiceNameComposeEmail)
service?.recipients = ["test#gmail.com"]
service?.subject = "Test Mail"
service?.performWithItems(["Test Mail body"])
Launch Mail App
If you just want to open Mail app, try below code:
NSWorkspace.sharedWorkspace().launchApplication("Mail")
Improper Setting:
If account is not configured on the system, this code will show configuration window for mail
When user will try to send mail it'll be shown improper setting related error by Mail app so you need not to bother about it
If you want to use other then Mail app, just try your own mail system, native mail client or third party mail framework.
Try from terminal:
You can use shell script to send mail using native client
mail -s "Hello" "test#gmail.com" <<EOF
Hello, Test!
EOF
For Swift 4, little changes.
let service = NSSharingService(named: NSSharingService.Name.composeEmail)
service?.recipients = ["test#gmail.com"]
service?.subject = "Test Mail"
service?.perform(withItems: ["Test Mail body"])
We've been running a new system in test for a while now and creating emails to a folder so they don't accidentally go out to clients. Now we've turned on live emailing we are getting issues with sending.
I'm using ActionMailer.NET and the code to create and send the email is below. I won't include the View:
EmailResult x = new EmailController().EmailWorkOrderForApprovalToClient(model);
System.Net.Mail.Attachment file = new System.Net.Mail.Attachment(FilePath);
x.Mail.Attachments.Add(file);
x.Deliver();
Which gives the error
The SMTP server requires a secure connection or the client was not
authenticated. The server response was: 5.7.57 SMTP; Client was not
authenticated to send anonymous mail during MAIL FROM
The web.config looks like this:
<system.net>
<mailSettings>
<smtp deliveryMethod="Network" from="ClientServices#topupconsultants.com">
<specifiedPickupDirectory pickupDirectoryLocation="" />
<network defaultCredentials="false" host="smtp.office365.com" password="secret" port="587" userName="ClientServices#myco.com" />
</smtp>
</mailSettings>
My assumption is that enableSsl="true" needs to be added to the network line, but when I do that and try to go to the SMTP Email section of the site in IIS, I get the error:
Unrecognized attribute 'enableSsl'
I'm not that hot on IIS, but I've checked that the Application Pool and its .NET CLR version is 4.0.30319. I've also checked that .NET v4.5 is installed on the server.
This is baffling me, and I'm hoping I don't have to totally change my code to a method that allows me to specify SSL at that point.
Answering my own question here, and basically the answer is: "Don't believe the error message". In all the configurations I tried, I believed the error message when it told me that is was unacceptable. However, I tried it anyway, and it uses the enableSsl attribute when it sends, and this allows the connection to Office 365 to succeed.
Slightly irritating IIS bug that I'll forget about in a week, but right now is very annoying.
This is issue on IIS no need to worry about this error message
SmtpClient object enableSsl value get mapped
this silly issue is wasted my much time :D
I have setup a catchall router on exim (used as last router):
catchall:
driver = redirect
domains = +local_domains
data = ${lookup{*#$domain}lsearch{/etc/aliases}}
retry_use_local_part
This works perfectly when sending emails locally. However, if I login to my GMail account and send an email to whatever#mydomain.com, then I get an "Unrouteable Address".
Thank you for any hints to solve this issue.
In the system_aliases: section of the config file you already have a section which does the lookup in /etc/aliases.
Replace
data = ${lookup{$local_part}lsearch{/etc/aliases}}
with
data = ${lookup{$local_part}lsearch*#{/etc/aliases}}
and make sure you have *:catchall_username* in /etc/aliases
This works great for a single domain mail server which is already using /etc/aliases
For this router to work, make sure that
mydomain.com is in local_domains
there is an entry for *#mydomain.com in /etc/aliases
MX record for mydomain.com is pointing to the server, where you've
configured this
This is old as heck, but I didn't see a good answer posted and someone else might want to know the answer.
This post is geared towards Debian with in single configuration file mode. It should work on any Linux Exim4 install though. For the purpose of explaining things we’ll use test#example.com which is configured with the hostname mail.example.com. The system will have a real user called test and we want to create an alias for test called alias. So the end result will all email sent to alias#example.com forwarded to test#example.com without having to create the user alias on the system.
First we need to create a place to store all of the alias files:
mkdir /etc/exim/aliases.d
vim /etc/exim/aliases.d/mail.example.com
contents of the alias file for mail.example.com alias:test
vim /etc/exim/exim4.conf.template
Now look for the section system_aliases. Here you’ll see data = ${lookup{$local_part}lsearch{/etc/aliases}} or something similar. Change that to
data = ${lookup{$local_part}lsearch{/etc/exim4/aliases.d/$domain}}
Save the file and restart exim. The alias should now work. To add support for other domains just add more alias files in the aliases.d directory with the correct hostname.
I copied and pasted this from my blog:
0xeb.info