This is bug which mostly not allowing you to go to first page or use back button, in version 3.4 it’s fixed but if you want to make just fix of 3.3 version, this is how you should do it open file /libraries/cms/router/site.php now find this
When you understood that many email are not delivered in your inbox which are sent from (Hotmail,Google or custom server) first of all you must check logs whats happening, if dns is configured properly and you see “Could not complete sender verify callout” in your logs which you can check in whm “Email”->” Mail Delivery Reports ” then this is because of Sender Verification Callouts
Use callouts to verify the existence of email senders. Exim will connect to the mail exchanger for a given address to verify it exists before accepting mail from it.
we can fix it very fast just go to “Exim Configuration Manager” in WHM and search for “Sender Verification Callout” check off which by the way is default, click save and test your mails.
This is tutorial how to enable NFS backup for WHM running on CENTOS 6
first of all we need to install NSF soft on centos use this commands to do this
yum install nfs-utils nfs-utils-lib
also install Portmap if it’s not installed
yum install rpcbind
Now we must start services
chkconfig nfs on
service rpcbind start
service nfs start
Okay now everything is installed and we must create directory and mount NFS
mkdir /home/nfsdir
mount -t nfs 15.15.45.65:/folder /home/nfsdir
Now just go to Backup Configuration in whm and set Default Backup Directory to in our situation /home/nfsdir, that’s all now backup will be saved in NFS which is mounted in your system.
It’s very easy to send email using PHP via SMTP, first of all you must downloads PHP Mailer (https://github.com/PHPMailer/PHPMailer), after we will use small script as an example which will connect to smtp and send email.
<?php
require_once "PHPMailer-master/PHPMailerAutoload.php";
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->Host = "mail.domain.com";
$mail->SMTPAuth = true;
$mail->Username = "username";
$mail->Password = "password";
$mail->From = "[email protected]";
$mail->FromName = "Your Name";
$mail->AddAddress("[email protected]");
$mail->WordWrap = 50;
$mail->IsHTML(true);
$mail->Subject = "This is subject";
$mail->Body = "THis is body <b>html</b>";
$mail->AltBody = "This is the body in plain text.";
if (!$mail->Send()) {
echo "Mailer Error: " . $mail->ErrorInfo;
} else {
echo "Message sent!";
}
You can print XML normally but it will not be formatted, we have solution which can help you to output XML in nice format We will use XmlTextWriter function to do this here is simple function which you can use in project.
public static String BeutyXML(String XML)
{
String Result = "";
MemoryStream mStream = new MemoryStream();
XmlTextWriter writer = new XmlTextWriter(mStream, Encoding.Unicode);
XmlDocument document = new XmlDocument();
try
{
document.LoadXml(XML);
writer.Formatting = Formatting.Indented;
document.WriteContentTo(writer);
writer.Flush();
mStream.Flush();
mStream.Position = 0;
StreamReader sReader = new StreamReader(mStream);
String FormattedXML = sReader.ReadToEnd();
Result = FormattedXML;
}
catch (XmlException)
{
}
mStream.Close();
writer.Close();
// Return formatted XML
return Result;
}
it’s very simple to read CSV and then get all information by columns this is simple code which will help you with it
try {
BufferedReader br = new BufferedReader(new FileReader("./customer-list.csv"));
while ((line = br.readLine()) != null) {
if (!line.isEmpty()) {
// use comma as separator
String[] data = line.split(",");
//data[0] contains first column if you want second one use data[1] and so on
System.out.println(data[0]);
}
}
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
Example how to skip first line of any file which you want to read using FileReader in Java
BufferedReader br = new BufferedReader(new FileReader("./test.csv"));
br.readLine();
while ((line = br.readLine()) != null) {
if (!line.isEmpty()) {
// use comma as separator
String[] data = line.split(",");
}
}
all what we are doing is adding br.readLine(); before while loop this will read first line so it will be skipped in loop.