w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
.NET MVC preventing forged POST
Use a viewmodel that accepts only the fields that should be updated and then populate the model with those values. You could use something like AutoMapper for mapping between the two.

Categories : Asp Net Mvc

Can $_SERVER['REMOTE_ADDR'] be forged to an arbitrary string?
No, it's impossible to fake. There are two faults with your code. You do sanitize things, by means of thinking if variable is "safe" or not. While you should format your SQL literal, leaving that burden of thinking on the prepared statement. You have some compromised way of getting $ip. Either $ip or $_SERVER['REMOTE_ADDR'] filled unsafe way. You can find a lot of answers here on SO to help you with.

Categories : PHP

Laravel 4 undefined method Request::forged()
You example is referring to Laravel 3. Here how you should be using it on Laravel 4 https://github.com/laravel/laravel/blob/master/app/filters.php#L74-L80

Categories : PHP

Sendmail Format
Your $h has a trailing newline on the end of it. Add a chomp to fix it: my $h=`hostname`; chomp $h; Also, it's a good idea to use lexical variables instead of global filehandles, and the three-argument form of open: open my $mail, '|-', '/usr/sbin/sendmail -t'; ## Mail Header print $mail "To: $to "; print $mail "From: $from "; print $mail "Subject: $subject "; ## Mail Body print $mail "Test Body "; close $mail;

Categories : Perl

CentOS, sendmail no corresponding with PHP
(Started as a comment but it's getting a bit long) You've provided no details of any attempt to resolve this yourself. What have you tried? It would be helpful if you provided the output of: <?php $mc=ini_get('sendmail_path'); print "config: $mc <br /> "; $p=explode(' ', $mc); if ($p[0]) { passthru("ls -l " . $p[0]); } else { print "no mua "; } print "<br /> "; print "running as " . posix_getlogin() . " <br />";

Categories : PHP

sendmail on OpenShift / PHP / CodeIgniter
OpenShift Online is hosted on Amazon's EC2 service. Most email servers are configured to detect and blacklist emails originating from EC2 when it detects spam. So although it may work initially, there is a chance that emails start to silently fail after some time due to being blacklisted. It is recommended to relay through 3rd party smtp server/service: https://www.openshift.com/blogs/email-in-the-cloud-with-mailgun https://www.openshift.com/blogs/enabling-transactional-email-on-paas-with-sendgrid

Categories : PHP

fake sendmail for windows
After researching this bug, it seems to be a bug of the mail() function. One alternative is to download the phpMailer library, and implement your mail function there. The other alternative, since you say that the second time it always works, is: if (!mail("example@gmail.com", "hey", "bye")) mail("example@gmail.com", "hey", "bye"); In other words, if it fails once then you try again. You might insert a 300-milisecond pause there in case Google needs some time to come back from sleep.

Categories : PHP

What is the difference between sendmail and Amazon SES on Ec2
There isn't much difference if you are sending only few emails. But if you are sending many emails daily like user notifications, promotion etc then amazon doesn't like then being send from EC2. Bulk emailing might get ec2 ip ranges blacklisted I guess, so when you send bulk emails from EC2, AWS will issue a notice. I have seen that when I had some configuration issue with my script and send a few hundred email in a very short period. Amazon provides a way to remove these limitation on EC2 by submitting a request through the link given below https://portal.aws.amazon.com/gp/aws/html-forms-controller/contactus/ec2-email-limit-rdns-request You might have to setup elasticips for the EC2 instances, DKIM signing mechanism, SPF record, antispam, TLS etc. Sending email using AWS SES apis are

Categories : Amazon

Force Content Type with sendmail
Try removing the extra semicolon on the content type: echo -e "MIME-Version: 1.0 Content-Type: text/plain " Also it's better to use arrays than parse a string with eval: #!/bin/bash SENDMAIL_BIN='/usr/sbin/sendmail' FROM_MAIL_ADDRESS='noreply@plop.com' FROM_MAIL_DISLAY='Test format mail' RECIPIENT_ADDRESSES='me@plop.com' MAIL_CMD=("$SENDMAIL_BIN" -f "$FROM_MAIL_ADDRESS" -F "$FROM_MAIL_DISLAY" "$RECIPIENT_ADDRESSES") (echo "Subject: Test format";echo -e "MIME-Version: 1.0 Content-Type: text/plain " && cat output.txt) | "${MAIL_CMD[@]}"

Categories : Bash

Trouble installing Fake Sendmail
Follow this guide. It worked for me after attempting other methods. http://yogeshchaugule.com/blog/2013/configure-sendmail-wamp Just make sure you have the path to sendmail.exe in your system path and that in stunnel.conf you only have one client service active at a time. You can use Gmail but I chose to use another smtp mail service provider.

Categories : PHP

php mail() sendmail, masquerade as any domain?
You could set the from address in the headers, however, beware that a lot of email clients will mark the emails as spam if the from address and the server domain don't match up. $headers = 'From: webmaster@example.com' . " " . 'Reply-To: webmaster@example.com'; // other headers mail($to, $subject, $message, $headers); As shown in the PHPDocs for mail()

Categories : PHP

adding attachment using sendmail from unix
Sendmail is an extremely simplistic program. It knows how to send a blob of text over smtp. If you want to have attachments, you're going to have to do the work of converting them into a blob of text and using (in your example) p.write() to add them into the message. That's hard - but you can use the email module (part of python core) to do a lot of the work for you. Even better, you can use smtplib (also part of core) to handle sending the mail. Check out http://docs.python.org/2/library/email-examples.html#email-examples for a worked example showing how to send a mail with attachments using email and smtplib

Categories : Python

Preventing Spam; Using Nodemailer; Using Sendmail
Here's a few reasons: http://www.codinghorror.com/blog/2010/04/so-youd-like-to-send-some-email-through-code.html There are also blacklists of ip addresses. Anything coming from these would just be ignored or regarded as spam. If your email is sent from a server which doesn't seem to be linked to the from address you'll have potential issues as well. Detecting spam and trying not to be seen as spam are both non trivial things. That's why a lot of mailing lists are done through a specialist provider.

Categories : Node Js

How can I use fake sendmail with SwiftMailer on Windows?
You need to use right transport: $transport = Swift_SendmailTransport::newInstance('C:usrlibsendmail.exe'); UPDATE Use this line: $transport = Swift_MailTransport::newInstance();

Categories : PHP

Activesync: Sendmail command with MIME Type
I am sure you have a blank character before the "To" keyword in your code. Let's remove it. Your data before you encode it to base64 encoding must to look like this: From: xxx@xxx.com To: xxx@xxx.com Subject: Mail Subject MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: base64 Test body Best regards,

Categories : IOS

UNIX Sendmail Change Sender in Header
This can be done through the header information of the content text file. Script will be like follows. Mail sending command cat mail_content.html | /usr/lib/sendmail -t mail_content.html From: donotreply@sample.com To: info@sample.com Subject: Subject of the mail Mime-Version: 1.0 Content-Type: text/html <h1>Sample html body</h1> Here at the "from" attribute you can define the from address.

Categories : Unix

How do I tell sendmail to use localhost port 2525 as a smart relay?
Suggested Fix: Specify mailer in smart host definition: define(`SMART_HOST', `relay:[10.10.22.4]') Explanation: I assume [10.10.22.4] is an IP address of local IP inteface. It makes it listed on sendmail's list of local email domain ($=w). Sendmail ignores "mailer-less" relays to names/addresses listed in $=w. (Sendmail does it in MailerToTriple rule set).

Categories : Misc

Unix sendmail - html embed image not working
The way you use echo to print the message headers it eats all double quotes - you need to escape them with a backslash (") to make it work. Also, your boundary is wrong. If you define boundary=--XYZ, then each message part needs to start with ----XYZ (you need to add two dashes), otherwise your boundary should be only XYZ. And the headers of the mime parts must be separated from the bodies by an empty line. If you really need to generate a mail from a shell script, then my advise would be to get rid of all the echo and use a heredoc instead: sendmail -t <<EOT TO: XXX@YYY.com FROM: <TEST_IMAGE@YYY.com> SUBJECT: Embed image test MIME-Version: 1.0 Content-Type: multipart/related;boundary="XYZ" --XYZ Content-Type: text/html; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit

Categories : HTML

Java SendMail sends mail after server is stopped
A couple of problems: >> is shell redirection. You are running the subprocess directly, so it probably got ignored. Also, you never handled the output written from the process, so it likely got buffered and blocked the process until the UI ended.

Categories : Java

To configure Sendmail to send email through Amazon SES using STARTTLS
Sendmail: Sending test messages with SMTP session tracking Below please find a test script for making sendmail send messages with SMTP session tracking. WARNING: The script requires root privileges. #/bin/sh SENDMAIL_BIN=/usr/sbin/sendmail # Change sender and recipient as needed in your case SENDER=john.doe@example.net RECIPIENT=jane.done@example.com SUBJECT=test SENDER_HDR=$SENDER SENDER_ENV=$SENDER RECIPIENT_HDR=$RECIPIENT RECIPIENT_ENV=$RECIPIENT # -Am - use sendmail.cf instead of submit.cf # -i - do not treat "single dot" line as "END OF MESSAGE" # -v - verbose mode (includes SMTP session tracking) # -d60.5 - track map lookups (including authinfo map lookups) # -d8.20 - track DNS lookups $SENDMAIL_BIN -i -v -Am -d60.5 -f$SENDER_ENV -- $RECIPIENT_ENV <<END_OF_MESSA

Categories : Misc

Sendmail in GAE dev sever doesn't show the email body
I ran into this same issue a couple weeks ago. I ended up adding the following VM arguments to eclipse when running the DevAppServer: -Dmail.log_mail_level=WARNING -Dmail.log_mail_body=true

Categories : Eclipse

How to set Content-type and MIME-Version headers in GmailApp.sendmail?
As far as I know, the GmailApp won't give you that kind of capabilities, it's their infrastructure and they want to have some control of what flows through, and rely on automated methods of determining that. On the other hand Custom Content Type can we set for attachment using the GmailAttachment.SetContentType method. Cheers

Categories : Email

How to exlude empty fields in sendmail function (Google Docs script editor)
Whenever you find yourself repeating code, using cut & paste, pause and think about writing a function to do the job instead. In this case, here's how we can spew out HTML for a table row only if it's non-blank: function addRowIfData( heading, item ) { var rowHtml = ''; if (item && item !== '') { rowHtml = "<tr>" + "<th align='left'>" + heading + "</th>" + "<td>"+ data[0][1] +"</td>" + "</tr>" } return rowHtml; } And this is what your original code collapses down to. I've left out many lines of the table, but you get the idea. var emailAddress = Session.getActiveUser().getEmail(); var body = "<HTML><BODY>" + "<P>" + "New Form submitted on: " + data[0][

Categories : HTML

Major CSS issue; text should be white, not blue. CSS selector issue, or !important issue?
These two classes have the blue color: .catalyst-widget-area a, .catalyst-widget-area a:visited { color: #3A639A !important; text-decoration: none !important; } This is why your text is blue. So make a new style sheet or change it.

Categories : CSS

Html.fromHtml within Gmail Sender .sendMail(string, string, string, string)
It has turned out that GMailSender is a custom class published by a stackoverflow user in this post. The easiest way to send HTML instead of plain text is to change the sendMail method from the link above and replace text/plain by text/html. Or you can add a parameter to the method and make it more customizable: public synchronized void sendMail(String subject, String body, String sender, String recipients, boolean isHtml) throws Exception { try{ MimeMessage message = new MimeMessage(session); String messageType = isHtml ? "text/html" : "text/plain"; DataHandler handler = new DataHandler(new ByteArrayDataSource(body.getBytes(), messageType)); message.setSender(new InternetAddress(sender)); message.setSubject(subject); mess

Categories : Android

bootstrap fluid layout spans, floating issue, white space at top issue
you have padding-top:60px set for body in choose.aspx, and while the navbar has position:fixed it looks ok, but bootstrap's responsive css makes it position:static for screens narrower than 979px, and body's padding makes this effect. You should either set .navbar:fixed to override bootstrap's responsive rule, or add css media query to make padding-top:0px for body when screen is narrower than 979px, at the same place where you make it 60 so in choose.aspx where you set body styles: body { padding-top: 60px; padding-bottom: 40px; } //+ add this @media (max-width: 979px) { body { padding-top: 0px; } }

Categories : CSS

Strange Github Issue - Permission Denied (publickey) even bitbucket has same issue
First of all: You don't use your public key to authenticate, but the private key. It looks like either you don't have the private key or you haven't told GitHub what your public key is. cat ~/.ssh/id_rsa.pub and then copy and paste that into the SSH keys in your GitHub account panel. If you're still having trouble, you could also try to contact GitHub Support at support@github.com.

Categories : GIT

HTML + CSS issue, Chrome/Safari vs Firefox text positioning issue
Add the following CSS to the container div: vertical-align: middle; display: table-cell; Example: <div style="vertical-align: middle; display: table-cell; height: 500px; width: 400px; border: 1px solid black;"> <div id="header-social-icons"><a href="http://test">C</a><a href="http://test">M</a><a href="http://test">F</a></div> <div>

Categories : HTML

Jenkins email-ext, pre-send script: How to replace Jira Issue string directly with a link to the issue?
You don't even need regular expression. See this script example: https://github.com/jenkinsci/email-ext-plugin/blob/master/src/main/resources/hudson/plugins/emailext/templates/groovy-html.template that shows you how to loop over your changeset.

Categories : Jenkins

Jenkins e-mail notification issue / Ubuntu server issue
Please try to check the use SSL. Here is the Email Notification set up that's working in my system. I've also tested it in Windows, mac, and linux machines and this setup works for those systems.

Categories : Jenkins

SQL server 2012 tables issue, sysdate and to_date issue
You have two issues: the function to get the current system date and time is called SYSDATETIME() in T-SQL/SQL Server (not sysdate) the way to convert a string to a date or datetime in T-SQL/SQL Server is using CAST or CONVERT (not TO_DATE - there is no such function in T-SQL) Use something like SELECT CAST('01-JAN-2008' AS DATE) or something like that (it's highly dependent on your language/date format settings in SQL Server whether it'll work or not). If you need to specify a specific format, you can use CONVERT which allows you to use one of the many predefined formats (see relevant details in the MSDN documentation). If that's still not enough - SQL Server 2012 has a new function called PARSE which allows you to specify any arbitrary date format that your string is formatted i

Categories : SQL

Issue with convert NULL to String or to Double Issue
check nullity against rs.getObject("price") if you find it null then don't do above thing instead just leave it to the default value (blank or whatever) you want Also handle NumberFormatException it could raise while converting String to Double if no proper value found

Categories : Java

Bootstrap Carousel slide issue (Issue with Handlebars perhaps?)
I got this error when I forgot to include the jQuery UI library. Add this line after you include jQuery. <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.9.1/jquery-ui.min.js"></scrip

Categories : Twitter

jQuery Cycle layout issue - added inline style (position:absolute) causing issue with layout
Hmm..made some changes to your code. See if this is what you needed: http://codepen.io/adityadineshsaxena/pen/hvmro CSS Changes: .left-top{ height: 365px !important; } .carousel-body { color: cyan; p { padding-top: 0; margin-top:5px; margin-bottom:5px; } }

Categories : Jquery

Making JSESSIONID secure creating an issue for login issue from no-secure context
Is there any way to move from secure page(https) to unsecured page(http) or vice versa if JSEESIONID is secure Not with a single cookie. The whole point of secure is to stop the cookie being sent in the clear to an HTTP page, where an eavesdropper can purloin it and use it to access the HTTPS page. To have a system where compromise of an HTTP cookie didn't break the HTTPS cookie too, you'd have to have two separate session cookies with different names and values. eg: an http_session cookie, without secure that only the HTTP version of the site reads, and an https_session cookie, with secure, that only the HTTPS version reads. The login process would have to set both cookies, and the session system would have to be tinkered with to tie both session IDs to the same bag of session stora

Categories : Java

Not sure what this issue is?
addItemListener expects an ItemListener to be passed as an argument. You are passing a class that extends ActionListener Instead of bronzeG.addItemListener(radioHand); use bronzeG.addActionListener(radioHand); Read How to Write an Action Listener

Categories : Java

Tic Tac Toe AI issue in C
You do not need a loop to set movement on the board. board[randomNum][randomNum1] = 'X'; is enough to set. And you probably call this function twice, because function plays only one move.

Categories : C

PHP SQL Has an issue
You can create a subquery which basically has all the ID's you need and have a left join against it. SELECT a.status_ID, IFNULL(MAX(b.id), 0) maxVal FROM ( SELECT 1 status_ID UNION ALL SELECT 2 UNION ALL SELECT 3 UNION ALL SELECT 4 ) a LEFT JOIN `table` b ON a.status_id = b.status_id GROUP BY a.status_id SQLFiddle Demo

Categories : PHP

CSS issue with UL > LI > LI
try this .menu ul > li + li{ border: 0 solid #333333; border-radius: 0 0 10px 10px; box-shadow: 0 5px 5px 0 rgba(0, 0, 0, 0.3); } please add + li in this above css .menu ul > li + li + li{ border: 0 solid #333333; border-radius: 0 0 10px 10px; box-shadow: 0 5px 5px 0 rgba(0, 0, 0, 0.3); } OR http://www.w3schools.com/cssref/tryit.asp?filename=trycss3_nth-last-child .menu ul li:nth-last-child(1) { border: 0 solid #333333; border-radius: 0 0 10px 10px; box-shadow: 0 5px 5px 0 rgba(0, 0, 0, 0.3);}

Categories : CSS

A log out issue (PHP)
It may because of session timeout problem.try to increase the session time by referring the following url. How do I expire a PHP session after 30 minutes?

Categories : PHP



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.