moodle email confirmation not working - php

I'm configuring Moodle for a school project and there is a problem in email confirmation process.
following are my configurations:
outgoing mail confirmations
SMTP hosts: stmp.gmail.com:465
STMP security:TLS
STMP Auth Type:LOGIN
SMTP username:****#gmail.com [*admin e-mail*]
SMTP password:****
SMTP session limit:1
no-reply domain
no-reply address:***#gmail.com [*admin e-mail*]
Allowed email domains :
Email display settings
Character set : UTF-8
Allow user to select character set :no
Allow attachments: yes
Email via information: always
when user signed up; admin gets a notification that new user required access but the new user wont get any confirmation email.[before and after confirmation from site admin]
no email can be found in spam or inbox.
please help!!!

For the outgoing mail configuration you should just leave all the settings blank or revert them to their defaults. Unless you have a dedicated SMTP server (i.e. one that is hosted within your organisation and is specifically configured to relay outgoing mail from your Moodle server) then you should just let Moodle use PHP's own mail libraries to send mail.
Hope this helps.

Related

Unable to send emails using Outlook SMTP accounts

When I send emails using outlook smtp i get following error
The server response was: 554 5.2.0
STOREDRV.Submission.Exception:SendAsDeniedException.MapiExceptionSendAsDenied;
Failed to process message due to a permanent exception with message
Cannot submit message. 16.55847:69000000,
17.43559:0000000060010000000000000000000000000000, 20.521"
I have no problem with other smtp servers.
It relates to that issue
This applies to all email clients using smtp server to send email.
Sometime near the beginning of July, there was a change that
disallowed you using a return email address that is not in your list
of verified email aliases or connected accounts. In other words, you
can't change the "From" field in emails you send to an anonymous email
address.
So to send email from outlook 365 you need add alias email to list of verified emails.

Outlook not receiving e-mails from php script

Okay, I'm at my whit's end here. I have a client whose site is hosted on GoDaddy and that uses Outlook. I've written a PHP script to send mail to one of their domain e-mail addresses from a contact form on their website.
I can get this e-mail to send to every single service except outlook/exchange/live/microsoft accounts.
I read that using PHPMailer was a good idea, so this is what I'm currently using to send mail:
//$mail->IsSMTP(); // telling the class to use SMTP
$mail->SMTPDebug = 2;
$mail->SMTPAuth = true;
$mail->SMTPSecure = "ssl";
$mail->Host = "a2plcpnl0287.prod.iad2.secureserver.net";
$mail->Port = 465;
$mail->Username = "test#alamohomefinance.com";
$mail->Password = "xxxxxxx";
$mail->SetFrom('yourname#yourdomain.com', 'First Last');
$mail->AddReplyTo("name#yourdomain.com","First Last");
$mail->Subject = "PHPMailer Test Subject via smtp (hotmail), basic";
$mail->AltBody = "To view the message, please use an HTML compatible email viewer!";
$mail->MsgHTML($body);
$address = "jakerevans2#live.com";
if(!$mail->Send()) {
error_log("Error from calculator!". $mail->ErrorInfo);
} else {
error_log("Success from calculator!");
}
This e-mail gets sent to my gmail account and some others, but not to my .live account or my client's Outlook address.
I've tried everything I've found on the internet so far, nothing is working. Any ideas or thoughts anyone?
Thanks!
EDIT:
The Godaddy server has an SPF record that reads: v=spf1 include:spf.protection.outlook.com -all
I've created a DKIM key from https://www.port25.com/dkim-wizard/ and added a DKIM TXT record to GoDaddy, with the following details:
Host: key1._domainkey.alamohomefinance.com
TXT Value: k=rsa\; p=MIIBIjA...
I've added a DKIM record, with the following details:
Name: _dmarc.alamohomefinance.com
TXT Value: v=DMARC1; p=quarantine; sp=none; ruf=mailto:user#example.com; rf=afrf; pct=100; ri=86400
Am testing now to see if these changes make a difference...
First up, you should look at the PHPMailer troubleshooting guide, which has a little section on GoDaddy, and many other problems.
You will get much better feedback on what's going on if you enable debug output of server messages, so set SMTPDebug = 2, and see what it says.
GoDaddy is known to block outbound SMTP, and generally will either simply fail to connect (see many questions on SO about that), or cause TLS verification failures as you get redirected transparently to their mail servers.
In your code you've got the smtp.live.com Host, but this username:
$mail->Username = "a2plcpnl0287.prod.iad2.secureserver.net"
secureserver.net is the domain used for GoDaddy's mail servers, and that user name is the name of an actual GoDaddy mail server, so it seems very unlikely that you should be using it as a user id for live.com, especially since GoDaddy will be rotating mail servers frequently, so you're unlikely to get the same one every time - is that really your login ID for live.com?
I'm also suspicious of the phrasing of your question: you do not need to connect to live.com to send email to live.com - there's nothing stopping you sending to a live.com address from a connection through gmail, so it sounds like you may have a conceptual issue. The Host, Username and Password properties are for the mail server that you send out through, not that you are sending mail to.
As I said, normally GoDaddy doesn't allow remote SMTP at all, so I'm very surprised if you've had it working without using a GoDaddy mail server, so I suspect you've had something else work, not what you think.
I can also see you've based your code on an obsolete example, so make sure you're running the latest PHPMailer.
Update:
I noticed something critical. The code does not call $mail->isSMTP();. This means that it's not using SMTP at all, it's using the default mail() function, and as such none of the SMTP config makes any difference at all. The message will be submitted to your local mail server, which will then relay through GoDaddy's server. Look in your mail server's log file to see what's happening, usually in /var/log/mail.log or similar.
Check your server ip on http://mxtoolbox.com/blacklists.aspx . I've noticed Microsoft is very picky about blacklisting. I've had this issue with a brand new I.P addresses that were acquired with an apparent bad rep. If your on godaddy on a shared account ip it's very likely either the ip or entire subnets are blocked by default.

Sendding emails is not working on SMF

My forum has a problem with sending emails :
i have configured my mail settings as the following :
Mail Type : smtp
SMTP Host : myhost
Port : 587
Username & password : a valid email account on my domain
when i click on forget password to test sending emails i got the following message in error log:
Sender address is not valid for your login. Check your email program settings
I am pretty sure that this account is correct, and i tried to add test mail script to my host with the following code :
<?php
$mail = mail("myEmail", "wahahahahahaahahahahaa","I like spamming your inbox!!!", "From: Myself<your_email#here.com");
if(!$mail){
echo 'mail is not sent!';
} else {
echo 'mail is sent :-)';
}
?>
and it prints
mail is sent :-)
What i am missing here ?
I agree with Eggyal - it sounds like the hosted SMTP server is not allowing mail to be sent from the MAIL FROM address that you are using, with the authentication credentials that you are using.
To confirm this, and to rule-out a problem with the way that your application is trying to send the message - you might want to try sending a message through this SMTP server using a standard mail client (such as Thunderbird or Outlook), and using the same MAIL FROM address and authentication credentials that your application is using. If this fails with the same error, then you've confirmed that the hosted SMTP server is not allowing mail to be sent from the MAIL FROM address that you are using, with the authentication credentials that you are using.
Problem Solved.
I added my gmail on webmaster email, i changed it to domain email user then the problem is solved

Send emails through SMTP using authentication in magento

I am working on a website where after enabling the authentication on SMTP server emails stop working.I installed the SMTP pro extension and on running self test it shows me
ASchroder.com SMTP Pro Self-test results
Testing outbound connectivity to Server:
Using SMTP configuration options
Connection to Host SMTP server successful.
Sending test email to your contact form address donotreply#example.com
Unable to send test email. Exception message was: Sender address is not valid for your login. Check your email program settings. ...
Please check and double check your username and password.
Contact Form test email used SMTPPro to send correctly.
Testing failed,
But this email address works on contact us form and valid email address.Emails are working on contact us form but not for forget password etc .Guide me so that i can fix the issue.Thanks

Emails headers with swiftmailer and Symfony 2

I asked a similar question earlier, but the context has changed a bit. I want to use swiftmailer to send an email in Symfony 2. The problem is I'm using the gmail SMTP server, and so when my message arrives, my email client shows it from gmail.com, rather than mydomain.com. How can I fix this?
$message = \Swift_Message::newInstance()
->setSubject('Hello Email')
->setFrom(array('digest#mydomain.com' => "Digest"))
->setSender(array('digest#mydomain.com' => "Digest"))
->setCharset('iso-8859-1')
->setContentType('text/html')
->setTo('myemail#gmail.com')
->setBody($this->renderView('email.html.twig', array()));
$this->get('mailer')->send($message);
The Gmail SMTP server only allows you to send mail using the email address you're aithenticating with. So if you configured Symfony with
mailer_transport: gmail
mailer_user: myemail#gmail.com
mailer_password: ******
All your messages we'll look like they're from myemail#gmail.com
What you can do maybe is use another smtp server that is more flexible in the types of From addresses they will allow. If you are on a local development server, you could use your ISP's SMTP server, or use one of the various email as a service provider, such as Sendgrid, Mailjet or postmarkapp
They all allow you to send messages from any address you can prove ownership of, after some configuration steps.
One thing that may be worth trying also if you really want to use the gmail smtp server, is to define your from address in your "Send mail as" Gmail configuration (in Settings -> Accounts). This will let your app send email using the configured adresses in the From: field.

Categories