Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 1 year ago.
The community reviewed whether to reopen this question 1 year ago and left it closed:
Original close reason(s) were not resolved
Improve this question
I am using SMTP to send emails by PHP.
My client has a shared hosting.
I created an email account there.
There is no information available about what will be the SMTP server for this account.
I have tried: smtp.domainname.com
But it's not able to connect.
How can I figure out my SMTP server host? any idea?
this really is a question for Serverfault.
Windows:
Open up a command prompt (CMD.exe)
Type nslookup and hit enter
Type set type=MX and hit enter
Type the domain name and hit enter, for example: google.com
The results will be a list of host names that are set up for SMTP
Linux:
Open a command prompt
Type dig domain.name MX and hit enter where domain.name is the domain you are trying to find out the smtp server for.
If you do not get any answers back from your dns server, there is a good chance that there isn't any SMTP Servers set up for that domain. If this is the case, do like other's have suggested and call the hosting companies tech support.
generally smtp servers name are smtp.yourdomain.com or mail.yourdomain.com
open command prompt try to run following two commands
>ping smtp.yourdomain.com
>ping mail.yourdomain.com
you will most probably get response from any one from the above two commands.and that will be your smtp server
If this doesn't work open your cpanel --> go to your mailing accounts -- > click on configure mail account -- > there somewhere in the page you will get the information about your smtp server
it will be written like this way may be :
Incoming Server: mail.yourdomain.com
IMAP Port: ---
POP3 Port: ---
Outgoing Server: mail.yourdomain.com
SMTP Port: ---
You could send yourself an email an look in the email header (In Outlook: Open the mail, View->Options, there is 'Internet headers)
You can use the dig/host command to look up the MX records to see which mail server is handling mails for this domain.
On Linux you can do it as following for example:
$ host google.com
google.com has address 74.125.127.100
google.com has address 74.125.67.100
google.com has address 74.125.45.100
google.com mail is handled by 10 google.com.s9a2.psmtp.com.
google.com mail is handled by 10 smtp2.google.com.
google.com mail is handled by 10 google.com.s9a1.psmtp.com.
google.com mail is handled by 100 google.com.s9b2.psmtp.com.
google.com mail is handled by 10 smtp1.google.com.
google.com mail is handled by 100 google.com.s9b1.psmtp.com.
(as you can see, google has quite a lot of mail servers)
If you are working with windows, you might use nslookup (?) or try some web tool (e.g. that one) to display the same information.
Although that will only tell you the mail server for that domain. All other settings which are required can't be gathered that way. You might have to ask the provider.
To automate the answer of #Jordan S. Jones at WIN/DOS command-line,
Put this in a batch file named: getmns.bat (get mail name server):
#echo off
if #%1==# goto USAGE
echo set type=MX>mnscmd.txt
echo %1>>mnscmd.txt
echo exit>>mnscmd.txt
nslookup<mnscmd.txt>mnsresult.txt
type mnsresult.txt
del mnsresult.txt
goto END
:USAGE
echo usage:
echo %0 domainname.ext
:END
echo.
For example:
getmns google.com
output:
google.com MX preference = 20, mail exchanger = alt1.aspmx.l.google.com
google.com MX preference = 10, mail exchanger = aspmx.l.google.com
google.com MX preference = 50, mail exchanger = alt4.aspmx.l.google.com
google.com MX preference = 40, mail exchanger = alt3.aspmx.l.google.com
google.com MX preference = 30, mail exchanger = alt2.aspmx.l.google.com
alt4.aspmx.l.google.com internet address = 74.125.25.27
alt3.aspmx.l.google.com internet address = 173.194.72.27
aspmx.l.google.com internet address = 173.194.65.27
alt1.aspmx.l.google.com internet address = 74.125.200.27
alt2.aspmx.l.google.com internet address = 64.233.187.27
For example to pipe the result again into a file do:
getmns google.com > google.mns.txt
:-D
Quick example:
On Ubuntu, if you are interested, for instance, in Gmail then open the Terminal and type:
nslookup -q=mx gmail.com
Related
so i'm trying to follow this tutorial for Registration : https://reactnativecode.com/react-native-user-registration-example-tutorial/#comment-878
i’m using WampServer on Windows 10. I did as mentioned.
I created a folder called “/react” under “C:\wamp64\www\react” and put the two .php files there .
when i put “localhost/react” in my browser i can see the .php files .
i changed the URL to : ‘http://localhost/react/user_registration.php’
But i’m still getting that error .. i’m not sure what i’m doing wrong here
This happens simply because react-native consider localhost as an URL but it doesn't have a domain :
Solution
On Windows =>
Run [Ctrl] + R
Then type : "cmd", press enter
write "ipconfig" then press enter
a list of IP configurations will show, copy the IP address besides "IPv4 Address", it's under "Ethernet adapter VirtualBox Host-Only Network #2:", it starts with 192.168.xxx.x
on MAC =>
http://osxdaily.com/2010/11/21/find-ip-address-mac/
You will now need to replace the URL with this IP Address
you will have this at the end : ‘http://192.168.xxx.x/react/user_registration.php’
as you've seen, i have replaced localhost to the ip address taken from the CMD [i.e IPV4 Address]
You can also use only free hosting website like Awardspace, 000Webhost to test your app on a real device. Use your local server or this ip address, you can't fetch the data from real device
Hope this will help you!
Franz
I am unable to get Open EdX to authenticate to my Gmail account to send registration emails. Here's what I'm working with:
New installation of Open EdX via Bitnami.
Edited lms.env.json and cms.env.json based on this guide from the Bitnami wiki, including adding EMAIL_HOST_USER and EMAIL_HOST_PASSWORD fields.
Recompiled and restarted server.
Registered a new user and got a successful response via the LMS (account created and let me in).
However, no email confirmation came through.
Google account that I'm using allows access for less secure apps.
Log shows the following:
File "/opt/bitnami/python/lib/python2.7/smtplib.py", line 731, in sendmail
raise SMTPSenderRefused(code, resp, from_addr)
SMTPSenderRefused: (530, '5.5.1 Authentication Required. Learn more at\n5.5.1 support.google.com/mail/answer/14257 x123sm6973392pfb.54 - gsmtp', u'nyedid#sandtontechnologies.com')
2016-05-10 19:22:38,850 INFO 13202 [audit] models.py:1802 - Login success - user.id: 5
2016-05-10 19:22:38,919 INFO 13202 [audit] views.py:1822 - Login success on new account creation - Test2
I can log in to the account with no problem.
The link provided in the error message (https://support.google.com/mail/answer/14257) notes that you may receive this error if you have 2-factor authentication enabled on your account. In that case, you should generate an App Password (https://support.google.com/accounts/answer/185834?hl=en#ASPs) specifically for your Open edX instance, and use that in place of your normal GMail password.
Does that help?
I have added mod_apns to my ejabberd server. You can find this module here.
my ejabberd.yml configuration is like this:
mod_apns:
address: "gateway.sandbox.push.apple.com"
port: 2195
certfile: "/Applications/ejabberd-15.10/conf/cert.pem"
keyfile: "/Applications/ejabberd-15.10/conf/key.pem"
password: "myPassword"
the address is sandbox since I am still in development phase. And I have tested my cert.pem and key.pem and they are valid and working.
I send my device token to ejabberd server like this:
<iq type="set" to="myEjabberdServer.com">
<register xmlns="https://apple.com/push">
<token>myDeviceTokenWithoutAnySpace</token>
</register>
</iq>
I can see my device token is saved in apns_users database.
But I still do not get notifications when my user is offline.
Am I doing anything wrong?
Does it work with gateway.sandbox.push.apple.com?
should my device token be without space and only characters?
I appreciate your help..
You have asked for an alternate approach. This alternate approach takes the process of triggering push notifications by the ejabberd server.
1. Use the mod_interact library. This will provide you an ability to transfer your messages to another url.
2. From there on you can use the direct HTTP call for push notifications
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
How to send mail from localhost SMTP (using Wamp,Xampp or etc..)? PHP mail() doesn't seem to work natively.
Can anybody give the instructions?
Method 1 (Preferred) - Using hMailServer
After installation, you need the following configuration to properly send mail from wampserver:
1) When you first open hMailServer Administrator, you need to add a new domain.
2) Click on the "Add Domain ..." button at the Welcome page.
3) Under the domain text field, enter your computer's IP, in this case it should be 127.0.0.1.
4) Click on the Save button.
5) Go to Settings>Protocols>SMTP and select "Delivery of Email" tab
6) Enter "localhost" in the localhost name field.
7) Click on the Save button.
If you need to send mail using a FROM addressee of another computer, you need to allow deliveries from External to External accounts. To do that, follow these steps:
1) Go to Settings>Advanced>IP Ranges and double click on "My Computer" which should have IP address of 127.0.0.1
2) Check the Allow Deliveries from External to External accounts checkbox.
3) Save settings using Save button.
(However, Windows Live/Hotmail has denied all emails coming from dynamic IPs, which most residential computers are using. The workaround is to use Gmail account )
Note to use Gmail users :
1) Go to Settings>Protocols>SMTP and select "Delivery of Email" tab
2) Enter "smtp.gmail.com" in the Remote Host name field.
3) Enter "465" as the port number
4) Check "Server requires authentication"
5) Enter gmail address in the Username
6) Enter gmail password in the password
7) Check "Use SSL"
(Note, From field doesnt function with gmail)
*p.s. For some people it might also be needed to untick everything under require SMTP authentication in :
for local : Settings>Advanced>IP Ranges>"My Computer"
for external : Settings>Advanced>IP Ranges>"Internet"
Method 2 - Using SendMail
You can use SendMail installation.
Method 3 - Using different methods
Use any of these methods.
Here's the steps to achieve this:
Download the sendmail.zip through this link
Now, extract the folder and put it to C:/wamp/. Make sure that these four files are present: sendmail.exe, libeay32.dll, ssleay32.ddl and sendmail.ini.
Open sendmail.ini and set the configuration as follows:
smtp_server=smtp.gmail.com
smtp_port=465
smtp_ssl=ssl
default_domain=localhost
error_logfile=error.log
debug_logfile=debug.log
auth_username=[your_gmail_account_username]#gmail.com
auth_password=[your_gmail_account_password]
pop3_server=
pop3_username=
pop3_password=
force_sender=
force_recipient=
hostname=localhost
Access your email account. Click the Gear Tool > Settings > Forwarding and POP/IMAP > IMAP access. Click "Enable IMAP", then save your changes.
Run your WAMP Server. Enable ssl_module under Apache Module.
Next, enable php_openssl and php_sockets under PHP.
Open php.ini and configure it as the codes below. Basically, you just have to set the sendmail_path.
[mail function]
; For Win32 only.
; http://php.net/smtp
;SMTP =
; http://php.net/smtp-port
;smtp_port = 25
; For Win32 only.
; http://php.net/sendmail-from
;sendmail_from = you#domain.com
; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
; http://php.net/sendmail-path
sendmail_path = "C:\wamp\sendmail\sendmail.exe -t -i"
Restart Wamp Server
I hope this will work for you..
You can use this library to send email ,if having issue with local xampp,wamp...
class.phpmailer.php,class.smtp.php
Write this code in file where your email function calls
include('class.phpmailer.php');
$mail = new PHPMailer();
$mail->IsHTML(true);
$mail->IsSMTP();
$mail->SMTPAuth = true;
$mail->SMTPSecure = "ssl";
$mail->Host = "smtp.gmail.com";
$mail->Port = 465;
$mail->Username = "your email ID";
$mail->Password = "your email password";
$fromname = "From Name in Email";
$To = trim($email,"\r\n");
$tContent = '';
$tContent .="<table width='550px' colspan='2' cellpadding='4'>
<tr><td align='center'><img src='imgpath' width='100' height='100'></td></tr>
<tr><td height='20'> </td></tr>
<tr>
<td>
<table cellspacing='1' cellpadding='1' width='100%' height='100%'>
<tr><td align='center'><h2>YOUR TEXT<h2></td></tr/>
<tr><td> </td></tr>
<tr><td align='center'>Name: ".trim(NAME,"\r\n")."</td></tr>
<tr><td align='center'>ABCD TEXT: ".$abcd."</td></tr>
<tr><td> </td></tr>
</table>
</td>
</tr>
</table>";
$mail->From = "From email";
$mail->FromName = $fromname;
$mail->Subject = "Your Details.";
$mail->Body = $tContent;
$mail->AddAddress($To);
$mail->set('X-Priority', '1'); //Priority 1 = High, 3 = Normal, 5 = low
$mail->Send();
you can directly send mail from php mail() function if you specified the smtp server and smtp port in php.ini, first ask the SMTP server credential to your ISP.
SMTP = smtp.wlink.com.np //put your ISP's smtp server
smtp_port = 25 // your ISP's smtp port.
then just restart the apache server and it will start working. ENjoy ...
I prefer using PHPMailer script to send emails from localhost as it lets me use my Gmail account as SMTP. You can find the PHPMailer from http://phpmailer.worxware.com/ . Help regarding how to use gmail as SMTP or any other SMTP can be found at http://www.mittalpatel.co.in/php_send_mail_from_localhost_using_gmail_smtp . Hope this helps!
If any one of you are getting error like following after following answer given by Afwe Wef
Warning: mail() [<a href='function.mail'>function.mail</a>]: SMTP server response:
550 The address is not valid. in c:\wamp\www\email.php
Go to php.ini
; For Win32 only.
; http://php.net/sendmail-from
sendmail_from = valideaccount#gmail.com
Enter valideaccount#gmail.com as your email id which you used to configure the hMailserver in front of sendmail_from .
your problem will be solved.
Tested on Wamp server2.2(Apache 2.2.22, php 5.3.13) on windows 8
If you are also getting following error
"APPLICATION" 6364 "2014-03-24 13:13:33.979" "SMTPDeliverer - Message 2: Relaying to host smtp.gmail.com."
"APPLICATION" 6364 "2014-03-24 13:13:34.415" "SMTPDeliverer - Message 2: Message could not be delivered. Scheduling it for later delivery in 60 minutes."
"APPLICATION" 6364 "2014-03-24 13:13:34.430" "SMTPDeliverer - Message 2: Message delivery thread completed."
You might have forgot to change the port from 25 to 465
I had to implement Password Reset policy....For which I had OpenSSO deployed on Glassfish server and OpenDS as the Data Store...I followed Indira's blog...
Password Reset With OpenDS
And executed all commands....Since I did not configure SMTP, when I try to Reset the Password of a particular User (Note: I hav specified a Gmail ID as the email Address of that user) after answering the Question, I get confirmation saying
"Your password has been reset but we are unable to send it to you. Contact your administrator."
How do I configure SMTP in OpenSSO and OpenDS?
OpenDS (and OpenDJ, the continuing open source project) has some global properties to point to the SMTP server.
Note that it doesn't support authentication at this point.
$ dsconfig set-global-configuration-prop --port 4444 --hostname hostname --bindDN "cn=Directory Manager" --bindPassword password --set smtp-server:smtp.example.com --trustAll --no-prompt
Kind regards,
Ludovic
I just had this problem, so for the record I think it's probably because you need to replace <Password-Administrator> in the WEB-INF/classes/amPasswordResetModuleMsgs*.properties files with a real email address.
I found that my Authentication debug log file had this error in it:
ERROR: Could not send email to user [Ljava.lang.String;#30720e48
com.sun.mail.smtp.SMTPSendFailedException: 553 5.5.4 <Password-Administrator>... Domain name required for sender address Password-Administrator
;
nested exception is:
com.sun.mail.smtp.SMTPSenderFailedException: 553 5.5.4 <Password-Administrator>... Domain name required for sender address Password-Administrator
at com.sun.mail.smtp.SMTPTransport.issueSendCommand(SMTPTransport.java:2057)
I found the solution on the OpenAM mailing list originally: http://lists.forgerock.org/pipermail/openam/2012-April/005912.html
I used this sed command to do update all the files at once:
sed -i -e 's/\<Password-Administrator\>/user#address\.com\.au/g' amPasswordResetModuleMsgs*.properties