473,513 Members | 2,665 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Sending email in php

32 New Member
hai all, i have this error :

Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\Program Files\xampp\htdocs\tabaru\lupapass.php on line 46

this is the coding :

Expand|Select|Wrap|Line Numbers
  1. $to = $v2;
  2. $from_header = "From: dvdexcalibur.com";
  3. $subject = "Password anda";
  4. $body = "Hai ".$v1." ini password anda : ".$v3." apabila anda ingin mengubah password anda, anda dapat pergi ke myaccount.";
  5. (line 46) if (mail($to, $subject, $body, $from_header)) {
  6. $err="Message successfully sent!, check email anda untuk mengetahui password anda";$sudah=1;
  7. } else {
  8. $err="Message delivery failed...";
  9. }
  10.  
what do i have to do? it seems that i have to set the smtp? i'm conffused, can anyone help me? thanks so much in advance
Oct 11 '08 #1
4 1225
Atli
5,058 Recognized Expert Expert
Hi.

To use the mail function, you need to set the SMTP and smtp_port values in your PHP.ini config file to valid values.

If you are using a local mail server, then the default values should work (unless you set it up to work on a different port), but if you plan on using a remote server, then you will have to find the details for that server and use them.

Usually you only need to set the location of the SMTP server (via the SMTP value). They rarely ever mess with the port.
Oct 11 '08 #2
ciro
1 New Member
Try PHPMailer:
http://sourceforge.net/projects/phpmailer
Oct 12 '08 #3
dbest5250
32 New Member
but how do i set the values for the SMTP port? what do set it to? thanks in advance
Oct 12 '08 #4
Atli
5,058 Recognized Expert Expert
but how do i set the values for the SMTP port? what do set it to? thanks in advance
That I can not tell you, because it will depend on the SMTP server you plan on using.

To send an email, you will need a email server, which is usually a SMTP server.
To send an email from PHP, you will need to configure PHP to use this server.

So, to begin with, you will need to either find an existing server online, like say; the email server you use with your email account.
Or, you will have to set one up yourself.

Its often easiest to use the server you use for your own email application, like Thunderbird or Outlook. You should be able to find all needed settings for that in the configuration for your email account.

I would also recommend PHPMailer or Swift Mailer rather than PHP's native mail function. They are usually much much easier to set up and work with.
Oct 12 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

3
7027
by: Paul Lamonby | last post by:
Hi, I am sending a file from the server as an email attachment. The file is being attached no problem and sending the email, but I get an error when I try to open it saying it is corrupt....
0
522
by: praba kar | last post by:
Dear All, I have doubt regarding mail sending smtplib module. The below code is I used to send a mail. ########################################## import email.Message import email.Utils...
3
6806
by: VB Programmer | last post by:
I have an ASPX page where I send out emails through my mail server mail.MyDomain.com. When I send emails to MyName@MyDomain.com it sends PERFECTLY. When I try sending an email to any other address...
3
3596
by: Ant | last post by:
Hi, I'm using the MailMessage & smtpMail classes in System.Web.Mail to send mail, however it's not sending any emails. I'm using it on a Windows 2003 server. The simplest way to use this is...
1
8154
by: Eric Sheu | last post by:
Greetings, I have been searching the web like mad for a solution to my SMTP problem. I am using Windows Server 2003 and ASP.NET 2.0 w/ C# to send out e-mails from a web site I have created to...
2
12139
by: =?Utf-8?B?QWRl?= | last post by:
HI All, I am encountering the following error when I try to send an email through a SMTP server. I believe the problem lies with the authentication part when the network crednetials are used,...
9
3434
by: JoeP | last post by:
Hi All, How can I find the reason for such an error: Failure sending mail. Some Code... oMailMessage.IsBodyHtml = False oMailMessage.Body = cEmailBody Dim oSMTP As New SmtpClient...
7
3316
by: bleachie | last post by:
Hey, I just need some help, my form seems to not send me all of the 'guestNames' and 'guestEmails' forms. i use this function to add more guestnames and guestemail fields based on the number of...
10
5046
by: Markgoldin | last post by:
I am sending an XML data from not dontnet process to a .Net via socket listener. Here is a data sample: <VFPData> <serverdata> <coderun>updateFloor</coderun> <area>MD2</area>...
31
12608
by: happyse27 | last post by:
Hi All, I am trying for weeks how to send email from windows pc, which from my gmail account to my hotmail account. Using net::smtp module sending email failed,Kindly assist. (for the item d it...
0
7257
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7157
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7379
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7098
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7521
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5682
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4745
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
1
798
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
455
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.