-
Posts
24 -
Joined
-
Last visited
Everything posted by ChatGPT 🤖
-
oh cool! thank you! I will have a look at that!
-
ok.. my system must be badly configured for some reason.. Mailutils is installed and working, but when i am done writing the body of the e-mail.. I press ctrl + D to proceed to the sending of the e-mail.. but nothing happens..
-
yes you are right.. but the thing is that every required module is installed... sendmail, mailutils.. etc.. :/ Also, I am trying to send e-mail from the terminal, but for some reason I have not moved further after typing the message.. im hitting Ctrl + D but nothing happens.. wtf????!!!!!!
-
Also, the php manual saya that no installation of any kind of mail server is required because these things come with the PHP core files.. http://gr2.php.net/manual/en/mail.installation.php
-
I have actually installed sendmail.. not sure If i should install Postfix as well.. or not sure which one to use.. I used this http://www.yolinux.c...S/Sendmail.html but still it doesnt work.. :/
-
im running linux ubuntu.. and I have no idea how to set up those.. do these come with the installation of Apache?
-
on my own environment (localhost), the thing is that others (and you) have tested my script as well.. to check if it is working and it does.. so i know that the script works fine.. what i dont know is what i have done wrong on the php.ini file.. because I am pretty sure that thats where the problem is.. :/
-
no error messages, nothing.. just "Failed to send email!".. :/
-
yes thats what i want to do.. i tried the new script you posted.. still it does not send e-mails.. I am pretty sure its a configuration issue.. Would you mind posting the [mail function] of your php.ini file? So, I can compare it with mine.. Thank you for helping me out by the way..
-
and thats how I have my [mail function] set up in my php.ini [mail function] ; For Win32 only. ; http://php.net/smtp SMTP = localhost ; http://php.net/smtp-port smtp_port = 25 ; For Win32 only. ; http://php.net/sendmail-from sendmail_from = "From:" [email protected] ; For Unix only. You may supply arguments as well (default: "sendmail -t -i"). ; http://php.net/sendmail-path sendmail_path = /usr/sbin/sendmail -t -i ; Force the addition of the specified parameters to be passed as extra parameters ; to the sendmail binary. These parameters will always replace the value of ; the 5th parameter to mail(), even in safe mode. ;mail.force_extra_parameters = ; Add X-PHP-Originating-Script: that will include uid of the script followed by the filename mail.add_x_header = 0 ; The path to a log file that will log all mail() calls. Log entries include ; the full path of the script, line number, To address and headers. mail.log = /var/log/mail.log
-
I am confused.. and now I am 100% sure that there is something wrong with my configuration.. If i use your script.. I get "Failed to send e-mail"..
-
SMTP and SMTP_PORT are the same.. the from address is inactive.. Am I supposed to put my e-mail address there? though why should I put my e-mail address? the e-mails should be sent to my e-mail address not from my e-mail address.. I am making this form for other to be able to send me e-mails.. not for me to send e-mails..
-
No it doesn't.. I get If i try to execute it again without the I can see that the data are getting stored in the variables but the e-mail is not being sent.. Can you show me how you have set up your [mail function] in your php.ini file? I follow the runtime configuration from the php manual in order to configure mine, but still i can't send e-mails.. :/
-
Hello, I wrote an emailer script to add to my web site. The code seems to be fine and the variables seem to parse, but still I can not send an e-mail. Could you please tell me what am I doing wrong? I think the error is somewhere in the sendEmail function, but a second opinion is always better to have. The code is: <?php class emailer { private $sender; private $subject; private $body; function __construct($sender) { $this->sender = $sender; //$this->recipient = $recipient; } function addSender($sender){ $this->sender = $sender; } function addSubject($subject){ $this->subject = $subject; } function addBody($body){ $this->body = $body; } function sendEmail(){ $this->recipient = '[email protected]'; $this->result = mail($this->recipient, $this->subject, $this->body, "From: {$this->sender} \r\n"); if (!$this->result){ echo $this->result; echo $this->recipient; echo $this->sender; echo $this->subject; echo $this->body; echo "Error"; } else{ echo "e-mail was sent."; } } } ?> Thank you in advance. PS. when I execute the script, I get as output "Error", and I also get the data stored in the variables (recipient,sender,subject, and body).
-
what u read is what u get.. i am not giving any more info because i obviously dont want to, for several reasons.. either reply with a suggestion/solution or dont reply at all..
-
im trying to make a php scanner to scan text in php for any missing commands, if there are no commands found, similar to the ones stored in DB, it will post the data stored in the DB.
-
Hello, I am trying to make a php text scanner, which will scan text to identify similar words, and I am trying to find a way which would allow me to compare the data found on a Database with the data that the user sends. Can someone please point me to a guide or tutorial or something, that would help me with my project? Thanks in advance.
-
ok i have found the problem.. it was in the storeData object.. i should do this storeData($name, $email, $text) instead of this storeData() in order to parse the values of those variables in the function.. damn it.. stupid mistakes.. now it stores and retrieves the data found in the DB as expected.. Thanks a lot PFMaBiSmAd for helping me out.. I really appreciate it.
-
nice thank you.. both functions work now.. but not properly.. they seem to store and retrieve data from the DB but the storeData function does not actually work as the DB is empty.. any ideas why is that?
-
Hello, I have written a script in order to store and retrieve data from a database. The script used to work until i had to re-install lampp from the scratch. After the installation i had to do a lot of debugging and change the code a bit in order to overcome most errors and get closer to a working state. Here is the script. <?php class dataManipulation { public $name; public $text; public $email; function _constructor(){ $this->host = "localhost"; $this->uname = "root"; $this->pword = "1111"; $this->dbname = "testStorage"; $this->dbtable = "userData"; } function retrData(){ $this->dbconnect = mysql_connect($this->host, $this->uname, $this->pword); if (!$this->dbconnect) die("Connection Unable " . mysql_error()); mysql_select_db(`$this->dbname`); $sql_query = "SELECT * FROM `$this->dbtable`"; $result = mysql_query($sql_query) or die(mysql_error()); //echo "<br/>" . $sql_query; while ($list = mysql_fetch_assoc($result)) { echo $list['name']; echo $list['email']; echo $list['text']; echo "<br/>"; } mysql_close($sql_query); } function storeData(){ $this->dbConnect = mysql_connect($this->host, $this->uname, $this->pword); if (!$this->dbConnect) die("Could not connect " . mysql_error()); mysql_select_db(`$this->dbname`); $sql_query = "INSERT INTO `$this->dbtable` VALUES('$name', '$email', '$text')"; $result = mysql_query($sql_query); if ($result){ echo "Data storage succesful <br/> . $result"; } else { echo "Error <br/>" . mysql_error(); } mysql_close($sql_query); } } ?> the problem in both functions is that they cannot see the values inside the variables $this->dbname and $this->dbtable, therefore i get an error "Invalid table name" or if I move those two variables from the constructor into each function separately I get another error "No database found". Now if I switch the variables with the values necessary the script works but it does not actually store anything in the database. The database is empty. + note that the " ` " symbol is used around the table and database variables, otherwise I would get a mysql syntax error.. Anybody knows what is wrong here? Any help would much appreciated. Thanks in advance.
-
ok so the most important mistake was this <?php include 'dataGet.class.php'; $data= new getData(); $data= getData($name, $email, $text); ?> which should have been.. <?php include 'dataGet.class.php'; $data= new getData(); $data->retrData($name, $email, $text); ?> now both scripts work.. i just get an sql error now.. but i know how to fix it..
-
thanks a lot for your help guys.. but i have fixed.. made some stupid mistakes.. don't know why i couldn't see them.. :/ anyway.. now it works so.. Thanks again!
-
I don't think that the answers you provided are correct.. i actually tried all of the suggestions you made but still it does not work.. + as far as i know this is not necessary $data = new getData($name, $email, $text); i have already defined them on the third line of the Initiator script, if you see..
-
Hello, I am writing a data retrieval script, in order to print data stored in a DB. For some reason the script does not work.. More details below.. the form that calls the initiator script.. <form method='get' action="init.Get.php"> <div><input type="submit" name="get" value="See Data"></div> </form> the initiator script <?php include 'dataGet.class.php'; $data= new getData(); $data= getData($name, $email, $text); ?> my class.. <?php class getData { private $name; private $email; private $text; function __construct(){ $this->host = 'localhost'; $this->uname = 'root'; $this->pword = '1111'; $this->dbname = 'teststorage'; $this->dbtable = 'userData'; } function getData($name, $email, $text){ $this->dbconnect = mysql_connect($this->host, $this->uname, $this->pword); if (!$this->dbconnect) die("Connection Unable " . mysql_error()); mysql_select_db($this->dbname); $sql_query = "SELECT * FROM $this->dbtable "; $result = mysql_query($sql_query); if ($result){ echo $result; } else{ echo "Retrieval Unsuccesful"; } mysql_close($sql_query); } } ?> Can someone please tell me what am I doing wrong? Thank you in advance.