-
Posts
960 -
Joined
-
Last visited
Posts posted by Destramic
-
-
The confusing part with your thread is that you have moved to a different set up, and/or you aren't giving enough info.
yeah im not trying to send a multipart email plain text and html =/...basically if i just sent a plain or email without it being multipart it sends perfectly
I normally suggest that people use phpmailer, as they make it somewhat easier.
i'm not a fan of using script other people have used...i like to break something down and write it myself...but i can't workout for the life of me why the message is blank
-
$command = "From: BiSi.bid <noreply@bisi.bid>" . $this->_CRLF; $command .= "To: Ricky Powell <ricky.powell@hotmail.co.uk>" . $this->_CRLF; $command .= "Subject: hello" . $this->_CRLF; $command .= "MIME-Version: 1.0" . $this->_CRLF; $command .= "Content-Type: multipart/alternative; boundary=" . $boundary . $this->_CRLF; $command .= "Content-Transfer-Encoding: 7bit" .$this->_CRLF; $command .= "--" . $boundary . $this->_CRLF; $command .= "Content-type: text/plain; charset=iso-8859-1" . $this->_CRLF; $command .= "Content-Transfer-Encoding: 7bit" . $this->_CRLF; $command .= "Content-Transfer-Encoding: quoted-printable" . $this->_CRLF; $command .= "plain text" . $this->_CRLF; $command .= "-- " . $boundary . $this->_CRLF; $command .= "Content-type: text/html; charset=iso-8859-1" . $this->_CRLF; $command .= "Content-Transfer-Encoding: 7bit" . $this->_CRLF; $command .= "Content-Transfer-Encoding: quoted-printable" . $this->_CRLF; $command .= "<b>hello</b>" . $this->_CRLF; $command .= "--" . $boundary . "--" . $this->_CRLF; $this->send_command($command . '.' . $this->_CRLF); print_r($this->get_response());
after playing with the code i not get the email in my inbox but the message is empty...any ideas why?
-
anyone able to help on this ball ache, multipart emial please?
-
ok well i found out i needed to set the content type to multipart/alternative with boundaries
some reason its not sending to my inbox...can anyone please tell me why?
$boundary = uniqid('email'); $command = "MIME-Version: 1.0" . $this->_CRLF; $command .= "To: Ricky Powell <ricky.powell@hotmail.co.uk>" . $this->_CRLF; $command .= "From: BiSi.bid <noreply@bisi.bid>" . $this->_CRLF; $command .= "Subject: hello" . $this->_CRLF; $command .= "Content-Type: multipart/alternative; boundary=$boundary". $this->_CRLF; $command .= "Content-type: text/plain; charset=iso-8859-1" . $this->_CRLF; $command .= "Content-Transfer-Encoding: quoted-printable" . $this->_CRLF; $command .= "This is a MIME encoded message" . $this->_CRLF; $command .= "-- " . $boundary . $this->_CRLF; $command .= "plain text" . $this->_CRLF; $command .= "-- " . $boundary . $this->_CRLF; $command .= "Content-type: text/html; charset=iso-8859-1" . $this->_CRLF; $command .= "Content-Transfer-Encoding: quoted-printable" . $this->_CRLF; $command .= "<b>html text</b>" . $this->_CRLF; $command .= $this->_CRLF . "--" . $boundary . "--" . $this->_CRLF; $this->send_command($command); $this->send_command('.' . $this->_CRLF); print_r($this->get_response());
thank you
-
i got working now...i didnt add the DOT at the end of the message
now that being done can i just ask a few questions please...
1. how do i add a body and a altbody?...for instance if the recipient doesn't support HTML emails i just just send alt-body.
2. what the difference between connection normally to the server to connecting using telnet? ie.
fsockopen($host . ":" . $port, $error_number, $error_string, $timeout);
vs
fsockopen('telnet ' . $host . ' ' . $port);
thank you
-
i have been using \r\n on the other commands but the tutorial just used \n on that part so i assumed it was right...but after changing it i got the ok message ...so thank you
Array (
=> 250 [message] => 2.1.0 Ok )
but...i haven't received nothing in either of my inbox's...and ideas to why it would say ok but why i would get no email?
thanks for the tip...i would do this on every fputs execution right?
thanks again
-
hey guys i'm trying to test and send a email via SMTP...now i'm able to connect to server and auth login which is fine...but im having a problem sending the email using this line...everything else returns ok from the server.
problem is on this line:
fputs($this->_smtp_connection, "To: ricky.powell@hotmail.co.uk, destramic@gmail.com\nFrom: noreply@bisi.bis\nSubject: hello\n$headers\n\n$message\n\n");
when using this code the server times out displaying error 500...i've tried to look if the command im using is correct and from what i can see on a tutorial it checks out.
the code im using after connect and auth
fputs($this->_smtp_connection, "MAIL FROM: noreply@bisi.bid" . $this->_CRLF); print_r($this->get_response()); fputs($this->_smtp_connection, "RCPT TO: ricky.powell@hotmail.co.uk" . $this->_CRLF); fputs($this->_smtp_connection, "RCPT TO: destramic@gmail.com" . $this->_CRLF); print_r($this->get_response()); fputs($this->_smtp_connection, "DATA" . $this->_CRLF); print_r($this->get_response()); $headers = "MIME-Version: 1.0" . $this->_CRLF; $headers .= "Content-type: text/html; charset=iso-8859-1" . $this->_CRLF; $headers .= "To: Ricky Powell <ricky.powell@hotmail.co.uk>" . $this->_CRLF; $headers .= "To: Ricky Powell <destramic@>gmail.com" . $this->_CRLF; $headers .= "From: noreply@bisi.bid <bisi.bid>" . $this->_CRLF; $message = "hello ricky."; //fputs($this->_smtp_connection, "To: ricky.powell@hotmail.co.uk, destramic@gmail.com\nFrom: noreply@bisi.bis\nSubject: hello\n$headers\n\n$message\n\n"); // print_r($this->get_response());
any help would be greatful...thank guys
-
hey guys i've been having a problem with my server which displays the following:
Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator to inform of the time the error occurred and of anything you might have done that may have caused the error. More information about this error may be available in the server error log.
and the problem was when i was calling for a class property which didn't exists...i was calling:
$this->_ports; //instead of $this->_port;
now surly that should of just throw a error as i have error reporting on?
error log says:
[Tue Apr 21 19:32:56.998858 2015] [fcgid:warn] [pid 2871:tid 140557745637120] (104)Connection reset by peer: [client 185.4.135.150:44715] mod_fcgid: error reading data from FastCGI server [Tue Apr 21 19:32:56.998927 2015] [core:error] [pid 2871:tid 140557745637120] [client 185.4.135.150:44715] End of script output before headers: index.php
so i googled the problem and read to put this in my .htaccess but that hasn't helped
<IfModule mod_fcgid.c> IdleTimeout 300 ProcessLifeTime 3600 # MaxProcessCount 1000 DefaultMinClassProcessCount 0 DefaultMaxClassProcessCount 100 IPCConnectTimeout 360 IPCCommTimeout 360 BusyTimeout 300 </IfModule>
how can i stop the server from not displaying the page in the near future if i have a simple script error such as this?
thank you
-
hey guys...im trying to make a custom php.ini but im having some problems getting it to work.
i included the path to my custom php.ini in my .htaccess file
<IfModule mod_php5.c> php_value include_path ".:/var/www/vhosts/bisi.bid/bisi.bid/private/config" </IfModule>
then i put this in my http.conf
<Directory "/var/www/vhosts/bisi.bid/bisi.bid"> AllowOverride All </Directory>
now when testing and when i put in my customer php.ini
date.timezone = "Europe/London"
i get result of Europe/Athens
echo ini_get('date.timezone');
can anyone please tell me what i've done wrong please...thank you
-
max_allowed_packet=288000
in my.cnf did the job
-
hey guys i'm trying to import a .sql file to the database in phpmyadmin on my centos 7 dedicated server but it calls error:
Error text: Gateway Time-out
how to i increase the timeout limit please?
thank you
-
instead of using
protected $post = array(); protected $get = array();
just allow you methods to get results directly from the $_POST or $_GET variable...that way it will always have up to date values
when using my example above, the "age" value will then be picked up.
<?php function test($name, $type = "POST") { $array = $_{$type}; return $array[$name]; } echo test('age');
-
<?php $_POST['name'] = "test"; $input = new Input; $_POST['age'] = "99"; if ($input->is_set('age', 'POST')) { echo "set"; } else { echo "not set"; }
if you call class and a global is set after then your class isn't gonna pick up
-
also i wouldn't set POST or GET array in a property but just get it directly from the global variable
- $_SERVER
- $_REQUEST
- $_POST
- $_GET
- $_FILES
- $_ENV
- $_COOKIE
- $_SESSION
-
simplicity is the way forward...you can also use your class to capture sessions...but that looks good to me
-
you case should look like this surly
case 'post': return (isset($this->_p[$name]) ? TRUE : FALSE; break; case 'get': return (isset($this->_g[$name]) ? TRUE : FALSE; break;
unless i missed something in your code?
or even better
public function is_set($name, $type="POST") { $method = $_{$type}; if (in_array($name, $method)) { return true; } return false; }
try using something like this...should work...although i'm doubting myself on $method variable and cant test code at the moment. Fingers Crossed
but have a look at the manual http://php.net/manual/en/language.oop5.php
-
glad to have helped
-
thanks for the information requinix
-
maybe something like this?
<script> dw_Tooltip.content_vars = { L1: { <?php $get_all_photos = mysqli_query($db, "select * from photos WHERE user_id='1'"); $photo_urls = array(); while ($photo = mysqli_fetch_array($get_all_photos)) { $photo_urls[] = $photo['url']; ?> img: '<?php echo $photo['url']; ?>', txt: '<?php echo $photo['capture']; ?>' <?php } ?> } } </script> <?php foreach ($photo_urls as $url){ ?> <a href='' class="showTip L1"><img src="<?php echo $url; ?>"/></a> <?php } ?>
-
good to see the site back up
-
hey guys i've changed my port on my apache to 8080 to stop any conflict with other applications, but now have to put port on end of address for localhost to work. ie.
127.0.0.1:8080 or http://localhost:8080
i know this may sound a bit silly but is there a way of using a virual host so that i can just execute http://localhost and it connect to http://localhost:8080?
thank you
-
ok well i think im getting somewhere now...although im trying to include a .conf file to the servers .conf file
im using:
Include /var/www/vhosts/system/bisi.bid/conf/vhost.conf
but returns error
Syntax error on line 1 of /var/www/vhosts/system/bisi.bid/conf/vhost.conf:
now if i try to alter direcory to customer config then it says directory/file not found so i know what i'm trying to include is right but just getting errors.
my server uses plesk 12 and i've done what it says in the manual.
any ideas what the problem could be?
thank you
-
im able to put apache directives when using using my plesk contol panel
so i added this line
LoadModule geoip_module /usr/local/apache/modules/mod_geoip.so
but im getting a error:
Syntax error on line 1 of /var/www/vhosts/system/bisi.bid/conf/vhost.conf: Cannot load /usr/local/apache/modules/mod_geoip.so into server: /usr/local/apache/modules/mod_geoip.so: cannot open shared object file: No such file or directory
but i've installed geo_ip module using putty...what do you suggest i do now?
-
ok well the log said:
[Mon Mar 16 13:00:05.984024 2015] [core:alert] [pid 32717:tid 140241604171520] [client 213.205.253.98:50627] /var/www/vhosts/bisi.bid/bisi.bid/.htaccess: LoadModule not allowed hereso i removed these lines from the .htaccess
LoadModule geoip_module /usr/local/apache/modules/mod_geoip.so GeoIPEnable On GeoIPDBFile /usr/share/GeoIP/GeoIP.dat MemoryCache
these are the modules on the server
core.c
mod_so.c
http_core.c
so im guessing i have installed the geoip module properly...what do you suggest i do please to get it installed?
thank you
session cookie
in PHP Coding Help
Posted
hey guys im trying to save a session as a cookie using
the problem im getting is that the session file ins't being saved in the directory i specifiy when usings session_set_cookie_params();
what i want to do is save the session cookie and when user closes browser and then re-enters the site the session is still there...(unless that's not how it works)
any help would great thanks guys