I'm trying to send a mail from my own domain server like xyz#mydomain.com in php.
I can successfully send mail using gmail account with pear package. But, sending messages from my own domain fails.
any idea..... how I should send messages from my own domain. I'm getting errors like
authentication failure [SMTP: SMTP server does not support authentication (
code: 250, response: EMU.dnsracks.com Hello [72.18.135.214] TURN SIZE 2097152
ETRN PIPELINING DSN ENHANCEDSTATUSCODES 8bitmime BINARYMIME CHUNKING VRFY OK)]
My mail address is xyz#mydomain.com
Any help would be appreciated.
you don't need to use smtp, just use the phpmailer class.
http://www.askapache.com/php/phpfreaks-eric-rosebrocks-phpmailer-tutorial.html
very easy to use and you'll be sending emails in minutes!
Related
I am trying to send email from the server but it's not sending it throws an error. In phpinfo() I checked mail function is enabled, what's wrong why mail is not sending if anybody has idea means please tell me,
This is my code,
<?php
$msg = "test cotent";
$send =mail("xxxxx#gmail.com","My subject",$msg);
if($send) echo 'sent!';
else echo $errorMessage = error_get_last()['message'];
?>
Error,
mail(): SMTP server response: 554 5.7.1 : Relay access denied
See the answer, may be it will help you.(Please see the last one)
Relay access denied on sending mail, Other domain outside of network
https://jefferyland.wordpress.com/2013/05/28/essential-exchange-troubleshooting-send-email-via-telnet/
Use PHP MAILER for cross domain mailing that way you can define your ports or if you still want to use mail Function you'll have to set up an email with your hosting eg abc#yourdomain.com else it wont allow you to send. mail function uses default mailer hosting urls
mail() function unable to connect with you SMTP that's why you are getting this problem.
To solve this problem you can use PHP MAILER library which is available in GitHub. Using php mailer you can define SMTP, PORT etc.
Either you can create a web mail in your server (info#example.com) and use it in your code.
Hope it will help you to send mail.
I am using phpmailer to send mail in Yii1. System which i have developed send thousand of emails daily. Normally it is working fine how ever sometime system fails to send email. After sometime that mail was delivered successfully (if system fails to send email first time then it will try again
). I am getting different types of email error some time. Not sure how to resolved those errors:
Mailer Error:
The following From address failed: test#test.com : MAIL not accepted
from server,x.x.x.x SMTP; Client was not authenticated to send
anonymous mail during MAIL FROM
[MWHPR11CA0017.namprd11.prod.outlook.com]SMTP server error: 5.7.57
SMTP; Client was not authenticated to send anonymous mail during MAIL
FROM [MWHPR11CA0017.namprd11.prod.outlook.com]
The following From address failed:
test#test.com : MAIL not accepted from server
SMTP Error:
Data not accepted.SMTP server error: 2.1.5 Recipient OK
The following From address failed:
test#test.com : MAIL not accepted from server,354,Start mail input;
end with < CRLF >.< CRLF >SMTP server error: Start mail input; end
with < CRLF >.< CRLF > SMTP server error: Start mail input; end with
< CRLF >.< CRLF >
SMTP Error:
The following recipients failed:xxx#xxx.com
So above is the different types of errors i have got sometimes. For #5 it seems that recipient was incorrect so that one is fine. But what about the others? How to solve them?
Depending on the MTA (mail transfer agent) installed on the server, ports used and SMPT settings, you may need to create the "from" user account on the server.
If you're using SSL/TLS, make sure the digital certificate(s) exist and has not expired. Also make sure your server's OS and MTA is up to date with the latest security standards -which if not compatible with latest industry standards may cause issues with the handshake/delivery mechanism.
you can always debug with command mail on your server. But as #argon already answered, the problem is probably with SMTP server.
I warmly suggest using external email marketing service if you are sending
thousand of emails daily.
Your server reputation will only get worse and will go straight to spam or rejected by SMTP (as in your case).
I have setup a postfix mail server to my local ubuntu system. it sends mail properly but for gmail account it is not received from gmail account.
here is the output of maillog
Jun 15 14:29:33 aum30 postfix/smtp[29509]: D2E95360910: to=, relay=gmail-smtp-in.l.google.com[74.125.24.26]:25, delay=3, delays=0.09/0/2.3/0.69, dsn=5.7.1, status=bounced (host gmail-smtp-in.l.google.com[74.125.24.26] said: 550-5.7.1 [117.223.148.98] The IP you're using to send mail is not authorized to 550-5.7.1 send email directly to our servers. Please use the SMTP relay at your 550-5.7.1 service provider instead. Learn more at 550 5.7.1 https://support.google.com/mail/?p=NotAuthorizedError g2si1886184plk.487 - gsmtp (in reply to end of DATA command))
How can I solve this?
Your ISP may provide SMTP relays which will accept mail from your IP, and these servers should be authorized to send mail.
Your IP 117.223.148.98 is on the PBL: https://www.spamhaus.org/pbl/query/PBL1528741
I know about the mail function in php:
mail ($to, $subject, $msg_body,$headers);
But since I cannot access my host's php.ini file, I've been provided with the following details:
SMTP host: mailout.host.com
Port: 25 SMTP
Username: email#domainname.com
SMTP Password: not required
Authentication: Disabled
Encryption: Disabled
How can I use these details to send out emails?
EDIT: I used example pointed by Blender (below) and it seems to work fine for all emails except gmail. Any idea why? Is it to do with Fully Qualified Address?
PHPMailer is a very well known and widely used alternative
Check out the SMTP mail example
You can use SwiftMailer (http://swiftmailer.org/) to send out emails through any email account you can login to, including gmail. It's very robust, but does have a bug where it uses a lot of memory for emails that have a lot of html in them.
i am using phpmailer to send mails it is working with gmail but when it comes to yahoo giving the following errors
SMTP -> Error : Password not accepted from server : 530 access denied
SMTP -> Error : RSET failed
SMTP -> Error : Could not authenticate
i am using the working yahoo account.
Please give me a solution.
Thanks in advance.
Try to use Yahoo SMTP with normal email client (e.g. Thunderbird) and see if it works then? If it works - then problem is in phpmailer, if not - maybe IP somehow landed in some spam-blacklist and Yahoo is simply rejecting all mails from it?