Jump to content

zoran

Members
  • Posts

    45
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

zoran's Achievements

Member

Member (2/5)

0

Reputation

  1. Hi, I am trying to install sendmail on my Ubuntu 12.4, but when I use: sudo apt-get install sendmail I get a message: Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package sendmail I could not find anything on the Internet on this for two days of searching.
  2. I want to create an application for sending mails using PHPMailer by placing it on my website server (using SMTP), but I can not get object of class phpmailer to change its properties of: to_name to_email ContentType from default (i.e. null). Why are the properties keeping default values from the PHPMailer class, and not accepting my once, though I check values i get from DB and they are good. ContentType is set in a config file. Here is part of var_dump ($mailer); object of my extended class: object(MyMailer)#2 (56) { ["priority"]=> int(3) ["to_name"]=> NULL ["to_email"]=> NULL ... ["ContentType"]=> string(10) "text/plain"... also I get value of ["Port"]=> int(26) but ["SMTP_PORT"]=> int(25). I need to use smtp port 26. And here is the extended class of phpmailer require_once './PHPMailer/class.phpmailer.php'; require_once 'mailer-config.php'; class MyMailer extends PHPMailer { var $priority = 3; var $to_name = null; var $to_email = null; var $From = null; var $FromName = null; var $Sender = null; var $ContentType = null; function MyMailer() { global $eSlanje; // Comes from mailer-config.php $eSlanje array if($eSlanje['smtp_mode'] == 'enabled') { $this->Host = $eSlanje['smtp_host']; $this->Port = $eSlanje['smtp_port']; if($eSlanje['smtp_username'] != '') { $this->SMTPAuth = true; $this->Username = $eSlanje['smtp_username']; $this->Password = $eSlanje['smtp_password']; } $this->Mailer = "smtp"; } if(!$this->From) { $this->From = $eSlanje['from_email']; } if(!$this->FromName) { $this->FromName = $eSlanje['from_name']; } if(!$this->Sender) { $this->Sender = $eSlanje['from_email']; } $this->Priority = $this->priority; //echo "<br>eSlanje[content_type]"; //var_dump ($eSlanje['content_type']); $this->ContentType = $eSlanje['content_type']; } } and here is the cofig file: mailer-config.php <?php $eSlanje['from_email'] = "hi@mysite.com"; $eSlanje['from_name'] = "Joe Blog"; $eSlanje['title'] = "hi there"; $eSlanje['content_type'] ="text/html"; $eSlanje['smtp_username'] = null; $eSlanje['smtp_mode'] = "enabled"; $eSlanje['smtp_port'] = 26; $eSlanje['smtp_host'] = "mail.mysite.com"; Here is where I insert values of email and name into the object: <?php session_start(); include ("password.php"); require_once 'class_lib/MyMailer.php'; require "class_lib/MySQL_Database.php"; require "get_email_template.php"; $db = new MySQL_Database (); $id = isset($_GET['id']) ? $_GET['id'] : false; $sql = "select email,ime from ".TABLE." where id = $id"; $query = mysql_query ($sql); $toClient = mysql_fetch_array($query); $to = isset($toClient['email']) ? $toClient['email'] : false; var_dump($to); // here I get a valid email address $to_name = isset($toClient['ime']) ? $toClient['ime'] : false; //var_dump($to_name); // here I get a valid preson's name $mailer = new MyMailer(); $mailer->AddAddress($to, $to_name); $mailer->Body = get_htmlBody(); $mailer->AltBody = get_txtBody(); if(!$mailer->Send()) { echo "<br> Mailer Error: " . $mailer->ErrorInfo."&nbsp"; } else { echo "<br>message not sent &nbsp"; } $mailer->ClearAddresses(); var_dump($mailer); // this is where the object trace comes from ?>
  3. I have created an application to help me reach potential employers. I send them e-mails and all the details are stored automatically in database. But the e-mails always end up in junk mail folder in my outlook. I am sending them from a web server. I am sending replies to employees looking for web designers, so it is not spam. I think that problem lies in e-mail headers. I am probably missing something. This is the part of the code that creates headers and sends mail: $headers .= 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; // Additional headers $headers .= 'From: my name <myname@yahoo.com>' . "\r\n"; $headers .= 'Cc: recipient list not shown:' . "\r\n"; $headers .= 'Bcc: myname@mydomain.com' . "\r\n"; $headers .= 'Message-ID: <20000811195938.10861.myname@yahoo.com>'; $start_Html = '<html><head></head><body>'; $end_Html = '</body></html>'; $emailBody = $start_Html .$emailBody.$CV.$end_Html; mail ($value, $mailTitle, $emailBody, $headers); I am sending the mails form a free web hosting server, because I do not want google indexing this application pages as part of my website.
  4. No, I have found out , through all day's work that my database was corrupted because I deleted something from one table that other table than could not fetch its data. thanks anyway
  5. One of my tables on my forum http://bananarepublika.net/forum seams to have stopped auto incrementing. I have been making some minor changes to the code. My site was also targeted my someone who changed string in the browser to show debateID=0 from a number that was coresponding to the debate. So he put some text in to the database, something silly I dont think it meaters. I have erased some rows from a table that were script injected, I think directly in phpmysql, and other texts I erased in the forum page. Now one of my tables has stopped incrementing. So no user can post any text to it. When I echo the $sql from mysql_query($sql), and try it manualy in phpmyadmin it gives out message that :" #1062 - Duplicate entry '127' for key 'PRIMARY'". I have tried deleting text with that key and I could insert one text after that. But on the next try it gives the same message. So I conclude that the auto increment key hung up on 127. Although when I check in the phpmyadmin in the operations it shows auto_increment 128. I am struggling all day long with this. Pleas help.
  6. thanks, what should I type to get info on structure of tables in my databases. I would like to also get an sql command that has created the table, e.g. create table customers, primary key ID (int) 25, if that can be found in the mysql console. ect.
  7. I am using wamp and I would like to check the structure of mysql tables with cmd, i.e. to see if they have unique index in a column and the sql command that was used to create the table etc. I am having intermittent problems with my tables. Values are sometimes inserted and updated and are not other times without apparent reason. and the code looks ok. so I need to check everything regarding table structure. I can not see all that in phpmyadmin because it is not all visible.
  8. I did <?php function connect_db_Blog (){ $con=mysql_connect("localhost","root",""); global $db; $db=mysql_select_db("blog",$con); } ?> and it sloved the problem, thanks Bricktop. Strangely , declaring $db with global $db=mysql_select_db("blog",$con); gave an error: Parse error: parse error, expecting `','' or `';'' in C:\wamp\www\nivodesign.com\scripts\php_functions.php on line 5
  9. I am trying to connect to database using a funciton in a functions.php <?php function connect_db_Blog (){ $con=mysql_connect("localhost","root",""); $db=mysql_select_db("blog",$con); } ?> which I then include with include ("scripts/php_functions.php"); but when I run a code with connect_db_Blog(); var_dump($db); if (!$db) { echo "sorry, cannot connect to database"; } else { here comes some code.. I get: sorry , cennot connect to database message. when I listen for $db with var_dump($db); I get int(0); instead of int(1) which is needed to proceed with the code. If I just try to connect to database without the include I dont get the error message i.e. .
  10. I have just realized that I was using get method instead of the mentioned post. thanks pal.
  11. I have created a simple submit form for a mysql database that puts a piece of code into database. But if I want to put a document of any decent length, eg. 500 characters (I guess), I get the error message, on submit: Request-URI Too Large The requested URL's length exceeds the capacity limit for this server. I am using post method . Server is Xampp. Is there a config file that needs to be modified to handle lager documents.
  12. I am using post method, Request-URI Too Large The requested URL's length exceeds the capacity limit for this server.
  13. I have created a simple submit form for a mysql database that puts a piece of code into database. But if I want to put a document of any decent length, eg. 500 characters (I guess), I get the error message, on submit. I am using xampp as server to run php. Is there a config file that needs to be modified to handle lager documents.
  14. No, it is working now varchar(90) solved it. Thanks all
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.