w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Sending mail with attachments
Try this: <?php //define the receiver of the email $to = 'youraddress@example.com'; //define the subject of the email $subject = 'Test email with attachment'; //create a boundary string. It must be unique //so we use the MD5 algorithm to generate a random hash $random_hash = md5(date('r', time())); //define the headers we want passed. Note that they are separated with $headers = "From: webmaster@example.com Reply-To: webmaster@example.com"; //add boundary string and mime type specification $headers .= " Content-Type: multipart/mixed; boundary="PHP-mixed-".$random_hash."""; //read the atachment file contents into a string, //encode it with MIME base64, //and split it into smaller chunks $attachment = chunk_split(base64_encode(file_get_contents('attachment.zip'))); //define the body

Categories : PHP

iOS MAilCore: How can i download mail attachments and show it in a webview?
it's very simple: first of all - get messages uid's MCOIndexSet *uidSet = [MCOIndexSet indexSetWithRange:MCORangeMake(1,UINT64_MAX)];//for all msgs MCOIMAPSession *session = <new or reuse IMAP session, i reuse this> MCOIMAPFetchMessagesOperation *fetchOp = [session fetchMessagesByUIDOperationWithFolder:@"INBOX" requestKind:MCOIMAPMessagesRequestKindFullHeaders uids:uidSet]; [fetchOp start:^(NSError *err, NSArray *messagesList, MCOIndexSet *vanished) { if (!err) { NSLog(@"Receive %i messages",(int)[messagesList count]); NSSortDescriptor *sort = [NSSortDescriptor sortDescriptorWithKey:@"header.date" ascending:NO]; //upd UI [[NSNotificationCenter defaultCenter] postN

Categories : Iphone

Getting email body without fetching attachments using ruby mail gem
You have to parse and understand the actual structure of the returned BODYSTRUCTURE response, see RFC 3501, p. 56. Also remember to apply the relevant Content-Transfer-Encoding (like base64 or quoted-printable) and employ proper charset conversion (the charset parameter of the Content-Type header of each body part). All of that information is included in the BODYSTRUCTURE response; consult your library's documentation to see how to get access to that.

Categories : Ruby

JBoss ESB -- Camel Mail message attachments (inbound)
Configure mapMailMessage=false, then you can access the source MailMessage API from the JavaMail API and you can grab the data yourself. See details at the Camel doc: http://camel.apache.org/mail.html

Categories : Java

mutt command with multiple attachments in single mail unix
Mutt doesn't support such syntax, but it doesn't mean it's impossible. You just have to build the mutt command. mutt -s "subject" $( printf -- '-a %q ' *.csv ) ... The command in $( ... ) produces something like this: -a aaa.csv -a bbb.csv -a ...

Categories : Unix

special character in a a tags href link when making a link to an email is not parsed right to the mail client
Looks like some kind of UTF-8 issue. Either the mail is sent using UTF 8 (and interpreted as ANSI) or something similar happens when parsing DOM or evaluating the link. But in general, you shouldn't put non-ANSI-characters into URLs. Instead, escape them using %HEXCODE. Also space characters should be replaced using %20 or +. Most programs (like web browsers or in this case Outlook) accept space characters and other things, but you still shouldn't rely on that behavior as it might go wrong (as it did here).

Categories : Firefox

E-mail app/filter that copies E-mail from the body of the letter and auto replies to that e-mail
I would suggest checking out Google Apps Script. You can create a script just like you would create any other Google Document in Drive by adding the Scripts module from the app store (Scripts is free and created by google). You can also use the gmail API to do the same thing. Both are very well documented and provide a surprisingly high level of access to your emails and their content.

Categories : Email

Why I send a mail with PHP, but receiver get a mail with attachment named "mail.html"?
Did you use any headers? $headers = 'MIME-Version: 1.0' . " "; $headers .= 'Content-type: text/html; charset=iso-8859-1' . " "; // Mail it mail($to, $subject, $message, $headers); Don't use foxmail so no clue if it works...but if you didn't send headers it's worth a try.

Categories : PHP

Html files parsed as php being parsed differently then *.php files
Well maybe it was a stupid question. I'm gonna answer it anyway: AddType application/x-httpd-php5 .html is the solution. EDIT: It turned out that my webhosting service had different versions of php installed and thus i needed to be more specific (thanks to the unknown commenter, who deleted his comment, for pointing me in the right direction about the reason behind it.

Categories : PHP

how to retreive value from Map?
why this Ljava.lang.String? Because each value is presumably a String[], and calling toString directly on an array doesn't give anything particularly useful - just the normal implementation inherited from Object, which indicates the type and the system-generated hash code. To get a useful representation, you could use: String key = (String) pairs.getKey(); String[] values = (String[]) pairs.getValue(); System.out.println(key + " = " + Arrays.toString(values)); Note that generics would make this much clearer, but if getParameterMap is only declared to return Map, you don't have a lot to go on. You could perform an unchecked cast to at least reduce the amount of code - but it's not actually giving you safety at the point of the cast: @SuppressWarnings("unchecked") Map<String, St

Categories : Java

Retreive a subdocument from Mongodb
All you need to do is project only the fields that you want. So on your dataset, return only items from cupboard will be: db.collection.find({ ... }, { 'Cupboard.Items' : 1, _id : 0 })

Categories : C#

How to use EWS to retrieve mail-related information about Exchange mail-enabled public folders
I'm able to get it with the following, you'll need to translate it to c#. The result is a folder object extended with an Email property. $PR_PF_PROXY = New-Object Microsoft.Exchange.WebServices.Data.ExtendedPropertyDefinition 26397,[Microsoft.Exchange.WebServices.Data.MapiPropertyType]::Binary $view.PropertySet.Add($PR_PF_PROXY) $foldersResult = $ExchangeService.FindFolders(Microsoft.Exchange.WebServices.Data.WellKnownFolderName]::PublicFoldersRoot,$view) foreach($folder in $foldersResult.Folders) { $folder = $folder | Add-Member -MemberType NoteProperty -Name Email -Value $null -PassThru $guid=$null if($folder.TryGetProperty($PR_PF_PROXY,[ref]$guid)) { $dn=[bitconverter]::ToString($guid) -replace '-' $folder.Email = ([

Categories : C#

postfix; pipe mail content to script for all mail of specific subdomain
It seems i solved the mystery problem. When i create an alias myself from test@example.com to test@vacation.example.com, the script gets called. mail.log Jul 12 15:20:55 mail postfix/pipe[14843]: 8854BB80B07: to=<test@vacation.example.com>, relay=vacation, delay=0.19, delays=0.07/0/0/0.12, dsn=2.0.0, status=sent (delivered via vacation service) vacation.pl logfile: 2013/07/12 15:21:27 DEBUG> /var/spool/vacation/vacation.pl:550 main:: - Script argument SMTP recipient is : 'test@vacation.example.com' and smtp_sender : 'peter@example.org' 2013/07/12 15:21:27 DEBUG> /var/spool/vacation/vacation.pl:580 main:: - Converted autoreply mailbox back to normal style - from test@vacation.example.com to test 2013/07/12 15:21:27 DEBUG> /var/spool/vacation/vacation.pl:590 main:: - Emai

Categories : Misc

Warning: mail(): SMTP server response: 550 This is a submission only port. You must authenticate before sending mail in
php.ini & SMTP= - how do you pass username & password PHP mail() command does not support authentication. Your options: ...

Categories : Email

Java Mail: Only one part of the message is retrieved / Parsing error / Badly formatted mail
JavaMail debugging tips are here. You can get the entire message text using the Message.writeTo method. Write it to a FileOutputStream or a ByteArrayOutputStream. You might have better luck using the JavaMail reference implementation instead of the Geronimo(?) version you're using.

Categories : Java

Multiple line processing by SED to change incoming e-mail sender and keep their e-mail within bugzilla comments
Using sed to parse MIME messages is going to be challenging, to say the least. Since you are already apparently using Perl for other things, I would implement this logic in a simple Perl script as well. Adding decoding for the various MIME content-transfer-encodings is then a trivial addition. Perl's Email::MIME package might be a good starting point. You already seem to have a basic understanding of the problem domain; many beginners would make the mistake of assuming that all messages are multiparts, or that all messages have exactly one text/plain part. (Maybe still emphasize that there may be none! Some clients just send a binary application/octet-stream if there is no textual content, or the client may be set up to only compose text/html and not generate a text/plain rendering fo

Categories : Email

How to retreive data from GWT Request Builder in C#
If you're using a GET method, the data parameter to sendRequest is ignored (because GET requests don't have a payload/body). So either switch to POST, then you'll be posting "raw data" (note: you should set the Content-Type header to match what you're sending; here it looks like text/plain), so you'll have it in Request.InputStream in ASP.NET MVC. You might have to seek back to the beginning of the stream though: see http://stackoverflow.com/a/17858159/116472 Or switch to a proper GET, passing the parameter in the URL somehow (query-string, whatever).

Categories : C#

retreive data from database in joomla 2.5
after $db=JFactory::getDBo(); $sql="create view agahi as(select ostan,count(id_useragahi) as text_agahi from #__npco_useragahi where published=1 group by ostan) "; $db->setQuery($sql); execute the query: $db->query()

Categories : Joomla

Java send mail automatically with local mail client
The answer is Java Mail API. Basically, you need a mail account (usually username+password), you also need the mail SP's SMTP server address, which is usually on their website.

Categories : Java

Can we send Multiple Mail in wso2esb in same sequence or dynamically set a mail
You can refer Proxy configuration in [1], which sends an email after retrieveing the email address from the database. [1]http://wso2.com/library/articles/2012/01/integrating-different-systems-with-wso2-esb

Categories : Wso2

SSIS E-mail Script issues. NOT SEND MAIL TASK
Hello bank teller, I'm a friend of Bob's and he said I can use his account. Honest. I might take money out but I'll put it back. This is essentially the conversation that is happening between your mail system and your SSIS package. The mail system isn't trusting that Alice has the authority to send email on Bob's behalf. Why it's silently swallowing the error is dependent on your code. Perhaps there's a status you aren't checking that signals the email was not sent. Update your question with your actual code if you want some eyes to review it. There are two options for resolution. The first, and probably least agreeable, is to have the From account authorize every possible user. Dumb, horrible and probably violates every practice known to man but it'd entail no code change. The "rig

Categories : SQL

Sending mail via Java API: How to send the mail even if attachment fails?
Yes. I would expect to be able to do (pseudo-code follows) try { // set up standard message try { // perform attachment } catch { // perhaps amend your original message to indicate attachment failed } send(); } catch { // handle a complete failure here... } although I'd concentrate on why the attachment fails. Does that even make sense ? You may take the approach of building/sending in two different methods, such that you don't have to clean up / modify your message in the face of a failure. That may be a cleaner approach e.g. (pseudo-code again) try { sendMessageWithAttachment(); } catch { sendMessageWithoutAttachment(); }

Categories : Java

Stop registration mail while sending invitation mail in ruby
I did this (and a few other modifications) by altering the devise_invitable controller action for create. The README has a section called "Configuring Controllers" to get you started down this road. You want to follow the instructions in that section to create a new controller that inherits from Devise::InvitationsController. In the newly-created controller include a create method that uses the skip_confirmation! method and then super (refer) to the parent controller to finish the action. This is untested code, but you'd have something like: class Users::InvitationsController < Devise::InvitationsController def create resource.skip_confirmation! super end end When I was figuring out how to modify the default Devise_Invitable behavior, I found looking at the sou

Categories : Ruby On Rails

PHP mail() in dev environment: open the mail in a browser/editor instead of sending it?
Include a means of determining your environment in your project, or at least some kind of global variable that holds that information. Then build an abstract mail interface that either sends real mails if it's running on a production server, but logs them to local files in case it runs on a dev machine / environment. As a logging package, I would recommend Monolog. This would allow you to design the rest of your application (or at least the mail sending components) in a way that doesn't have to care about the environment.

Categories : Email

Switched exchange servers, kept the same e-mail but some incoming mail is still going to the old server
I'm assuming that you changed the MX records for your domain, so that they now point to Microsoft 365's mail servers, correct? If so, it may take a day or two for the DNS changes to propagate.

Categories : Email

Default mail client continues to be running in background after mail is sent
Ok finally figured out the solution. The problem is, am using Application#Context to start the activity. When ever we use Application#Context a new Task is created ( that's why, adding the flag Intent.FLAG_ACTIVITY_NEW_TASK in the intent if we don't add this Flag then app crashes) . To avoid creation of new task all we need to do is use the right context ie., use the activities context. ("Be careful and avoid memory leaks in case storing the activity context reference"). So the code is as below Intent intent = new Intent(Intent.ACTION_SEND); intent.setType("message/rfc822"); intent.putExtra(Intent.EXTRA_SUBJECT, "Report issue: ""+mIssueTitle+"""); intent.putExtra(Intent.EXTRA_TEXT, mailBody); String[] mailIds = new String[] {getReportingMailId()}; intent.putExtra(Intent.EXTRA_EM

Categories : Android

What is the best way to generate HTML mail templates for the Grails mail plugin?
Templates can include other templates using the g:render tag. If you don't want the inline css mixed with your mail html, place it in its own template and use the render tag to insert it into the html template: mail/_css.gsp: <style type="text/css"> body { /* styles! */ } </style> mail/_message.gsp: <html> <head> <g:render template="/mail/css" /> <!-- render stylesheet into this template --> </head> <body> <!-- content --> </body> </html>

Categories : Grails

Invalid Addresses; nested exception is:com.sun.mail.smtp.SMTPAddressFailedException: 501 5.5.2 RCPT TO syntax error (When i try to send mail)
See this list of common JavaMail mistakes. Turn on JavaMail session debugging and post the protocol trace so we can see exactly what the server is complaining about. Most likely there's something wrong with one of the addresses you're using.

Categories : Java

Asp.net:How to fix exception thrown when sending mail message to multiple recipients?erroline:An invalid character was found in the mail header: ','
Please take a look at this. I don't know the credentials so I assume you can add them up. void Sendmail_Click(object sender, EventArgs e) { List<DAL.Customer> mailId = (from rs in General.db.Customers where rs.IsActive == true select rs).ToList(); SmtpClient smtp = new SmtpClient(); mailMessage.From = fromMail; mailMessage.IsBodyHtml = true; foreach (var item in mailId) { mailMessage.To.Add(new MailAddress(item.Email)); } lblStatus.Text = "Email sent successfully"; }

Categories : C#

javax.mail unable to send mail to hotmail
You named the properties mail.smtp*s* instead of mail.smtp There is already a question which is solved, have a look: Java Mail over TLS

Categories : Java

postfix 2.9.6.1 forward all mail to an external mail address
Finally found the answer. Listing here for posterity. Add the folowing line to the end of your main.cf file vi /etc/postfix/main.cf virtual_maps = hash:/etc/postfix/virtual, regexp:/etc/postfix/virtual-regexp Create a file which lists the mail address you want all mails to be sent to vi /etc/postfix/virtual-regexp Add the following: /.+@.+/ forwardingmailaddress@gmail.com add it to postmap postmap /etc/postfix/virtual-regexp you will need to add a virtual file. touch /etc/postfix/virtual now add it to postmap postmap /etc/postfix/virtual

Categories : Ubuntu

Exim Mail Transfer Agent can't deliver mail
Looks to me like your ISP has blocked connections outbound to tcp/25. Why did you reject your initial supposition that it was the firewall? The logs you quoted indicate that your server can make DNS requests, but there are no successful attempts to connect to a mail server. It could still be a local firewall issue but these days its very common for ISPs to prevent their clients from sending email to tcp/25 unless you have explicitly requested the ability to do so (and sometimes not even then). Take exim out of the equation and run this from the command line of your mail server: telnet 65.54.188.94 25 if you can connect, it's a problem with your exim install. If you can't connect, it's a network issue, whether a local firewall, ISP firewall, etc.

Categories : Email

Pear Mail script not authenticating to send mail
Ok, so I totally gave up on Pear::Mail and just converted the entire script to PHP_Mailer. It's now working with no issue function send_email($from, $to, $subject, $body) { ini_set("include_path", ".:/home/user/public_html/PHPMailer_v2.0.4/"); require_once("class.phpmailer.php"); global $debug; $mailer= new PHPMailer(); $mailer->IsSMTP(); $mailer->Host = 'localhost'; $mailer->SMTPAuth = true; $mailer->Username = "email"; $mailer->Password = "*******"; $mailer->FromName = "User"; $mailer->From = "email"; $mailer->AddAddress($to); $mailer->Subject = $subject; $mailer->Body = $body; if(!$mailer->Send()) { //echo "Message was not sent"; echo "Mailer Error: " . $mailer->ErrorInfo; exit;

Categories : PHP

Unable to get emails sent by PHP mail function because of another mail server
The first thing to establish is how you are sending emails (sendmail or SMTP). Then, whether your emails are a) not sent at all or b) getting rejected by the destination mail server. I'd check all available logs (source and destination mail servers and daemons). See if mail() itself is erroring. Try using sendmail/smtp directly. If its the destination server rejecting the mail based on its spam score, try setting SPF records to enable the web server to send mail legally.

Categories : PHP

zimbra doesnt receive mail from php mail function
Check logs on Zimbra MTA server, it's located at: /var/log/maillog Check if you see you php-server trying to reach Zimbra. You may get blocked cause Zimbra think you php-server is sending spam, or fail on one of many checks. Either way, the maillog should say something about it.

Categories : PHP

Retreive variable from if statement nested in .each function
The issue here is not the variable scope but that $('#other-amount') is undefined. I missed this because I thought it wouldn't matter if a radio input was checked instead. As suggested in the comments, I have rewritten this without .each(): var radioAmount; var checkedRadio = $('div.amount').find('input[type="radio"]:checked'); if(checkedRadio.length) { radioAmount = checkedRadio.attr('value'); } else { radioAmount = $('#other-amount').val(); } console.log(radioAmount);

Categories : Jquery

Sqlite does not retreive data when applied condition
Your data in database is exercise_mechanic=Isolation while your query is exercise_equipment=Isolation exercise_mechanic = 'Beginner' Your query is wrong. S

Categories : Android

Retreive Klout score using Email Address
We don't offer FacebookID because Facebook's TOS doesn't allow two 3rd party developers to transfer Facebook IDs between eachother. We don't offer email addresses to respect user's privacy, and it would only apply to a registered userbase. There are outside companies that provide email to social identifier translation, which may enable you to get at this data, but it's not something we're looking to provide directly in the near future.

Categories : Facebook

Can you use jQuery ajax to retreive data from Webservice?
While calling WebService, use GetAdmitsDischarges.asmx page for URL, not code-behind GetAdmitsDischarges.asmx.cs page. Also 1 more thing. You're doing GET request, by default WebServices don't allow it. You may have to add <webServices> <protocols> <add name="HttpGet"/> </protocols> </webServices> to your web.config.

Categories : C#

Retreive manufacturer information from device that AIR app is running on
On Windows, it's possible to query the motherboard's serial number with WMIC, or Windows Management Instrumentation Command-line. Therefore, you can simply pass the command wmic baseboard get serialnumber as an argument to cmd.exe using flash.desktop.NativeProcess without the need for a Native Extension. Since the AIR NativeProcess API is being used, you must use the Extended Desktop application profile and package your application with a native installer. package { //Imports import flash.display.Sprite; import flash.display.StageScaleMode; import flash.display.StageAlign; import flash.desktop.NativeProcess; import flash.desktop.NativeProcessStartupInfo; import flash.events.ProgressEvent; import flash.filesystem.File; //Class [SWF(width = "600",

Categories : Windows



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