473,775 Members | 2,186 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

setRequestHeade r method doesn't work with POP3

62 New Member
Hello
Refer to the thread that i have posted before: http://www.thescripts. com/forum/thread755824.ht ml

On that time i got problem about encode ajax to send email...everyth ing worked find after i use setRequestHeade r and encodeURICompon ent...but
then i test it with POP3 mail everything is not encoded...why ? And is it has some way to fix this ?
thank you so much
Paitoon
Jan 23 '08 #1
10 2057
acoder
16,027 Recognized Expert Moderator MVP
Show your code. What isn't encoded properly?
Jan 24 '08 #2
paitoon
62 New Member
this is some part in my AJAX:
Expand|Select|Wrap|Line Numbers
  1.  
  2.   var params = "sender=" + encodeURIComponent(document.iform.sender.value)+
  3.     "&email=" + encodeURIComponent(document.iform.email.value)+
  4.     "&subject=" + encodeURIComponent(document.iform.subject.value)+
  5.     "&text=" + encodeURIComponent(document.iform.text.value);
  6.  
  7.  
  8. xmlHttp=GetXmlHttpObject()  
  9. var url="process.php"
  10. xmlHttp.onreadystatechange=myResult; 
  11. open("POST",url,true)
  12. xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
  13. xmlHttp.send(params)
  14.  
  15.  
  16.  
  17.  
AND THIS IS MY PHP PAGE TO SEND MAIL
[php]<?php
$recipient = 'geisha@hotmail .com';
$params = $_POST['params'];
$subject = $_POST['subject'];
$from = $_POST['sender']; // variable SENDER from ajax
$email = $_POST['email'];
$text= $_POST['text'];
$ip = $_SERVER['REMOTE_ADDR'];

$msg = "From: $from\n Email: $email \n IP Adrress :$ip \n\n Message: $text";
mail($recipient , $subject, $msg);

?>[/php]

Everything worked good in hotmail, gmail, yahoo But not in web-mail or POP3 program.


Please tell me what should i do.
thanks a lot
Alex
Jan 24 '08 #3
acoder
16,027 Recognized Expert Moderator MVP
Can you send to a POP3 account without using Ajax?
Jan 24 '08 #4
paitoon
62 New Member
Actually yes, But I just want to know if it's possible or what is this problem etc..
Because it's work fine on normail mail but why it doesn't work with web-mail or pop3 ?
actually i was happy after i made everything hard finish and i use the time for this for a month (so hard) but a few days ago i opened it in web-mail and POP3 program it's disappoint me in the end my problem is not really gone...:-/

I did not expect that my site should be 100 % perfect but....i just wonder why ? I also tried to send email from my hotmail to that web-mail in thai language...ever ything is encoded and it's great work without going to VIEW and choose ENCODE on windows.

This is why i still stress and wonder how hotmail and other normal mail do, and why couldn't I.


But thank you so much at least U lead the way :-)
Alex
Jan 24 '08 #5
acoder
16,027 Recognized Expert Moderator MVP
So the text of the email is in Thai?

Have you set the correct headers/charsets? If, in PHP, you send email to the POP3/web-mail account using the mail function with Thai characters, does it send/receive OK?
Jan 24 '08 #6
paitoon
62 New Member
eventually i got it,
1. the reason that email not encoded in POP3 program that because i have to set the default encoded in the program to be UTF-8 (before it's western europe)
2. the reason that it's not encoded in web-mail (they use squrrel mail) because they just told me that they are not support asian langage.

Well, i got stress but got much more experiance. And i hope it will be the useful for other people also.

But i still wonder why gmail can do? I send message in Thai language to that POP3 and it's encoded correctly without setting anything.?Becau se gmail also use ajax.....

Thanks alot for all your help
Alex
Jan 24 '08 #7
acoder
16,027 Recognized Expert Moderator MVP
But i still wonder why gmail can do? I send message in Thai language to that POP3 and it's encoded correctly without setting anything.?Becau se gmail also use ajax...
You can set the header using setRequestHeade r, so it must be set to UTF-8.
Jan 25 '08 #8
paitoon
62 New Member
So you means in javascript ?'

xmlHttp.setRequ estHeader('Cont ent-Type', 'application/x-www-form-urlencoded');

i did it but it make email not work.

xmlHttp.setRequ estHeader('Cont ent-Type', 'application/x-www-form-uutf-8');
Jan 25 '08 #9
paitoon
62 New Member
But it ok....i give up
thank you so much
Alex
Jan 25 '08 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

1
5640
by: Daniel Albisser | last post by:
Hi @ll, I was wondering why I lose the connection to the mail store while retrieving information from it without calling the method store.close()! At the end I found out that the method folder.close(boolean) also close the store! Following you see the debug log of the JavaMail API: > C: QUIT
1
5961
by: Lev Altshuler | last post by:
Hi, I am trying to count email messages in the mailbox and read their headers. In case that there are some messages on the POP3 server and they haven't yet got to the Inbox, I get a number of messages. As soon as they have been in the Inbox, I get '0E0' as a number of messages. Does anyone know what feature of Net::POP3 I am not aware of, or where did I screw up in the code? use Net::POP3;
0
2608
by: Eric McDaniel | last post by:
This may be a question for ActiveState support, but just in case anyone out there knows what the problem is... My call to Net::POP3->new() works fine when run through the perl interpreter, but fails when I compile the script with PerlApp and run it. My system is Windows 2000, ActiveState Perl 5.8.0 build 806, PerlApp 5.2.0 build 520. Here is the script:
5
3454
by: Matt Kruse | last post by:
I'd like to test for Opera8.00's missing setRequestHeader method before actually instantiating the object. For example, this works in firefox: if (XMLHttpRequest.prototype.getRequestHeader) { ... } It causes an error in Opera8.00. In fact, doing typeof(XMLHttpRequest.prototype) returns 'undefined' in Opera8.00. I'm not sure how Opera is actually implementing the XMLHttpRequest object, but I suppose it's not a native object that can be...
4
2734
by: Ron Vecchi | last post by:
I a runnning w2k3 pop3 mail server that came with iis6. I would like to write an application that progammtically creates the new mailboxes in an already established mail domain. Does anyone know how I would access this funcationality? Thanks, Ron Vecchi
8
15613
by: TJ | last post by:
I need to be able to pass a pointer to a (managed code) Stream object to a COM method so it can serialize its data into the stream. I have a C# application that makes uses of Randolf Duke's MimeSniffer COM component (http://www.codeproject.com/internet/mimesniffer.asp). My application (pop3ImageGrabber) uses MimeSniffer to identify each image attachment in emails that have been collected from a POP3 mailbox. MimeSniffer gives the...
2
2834
by: Mike Brearley | last post by:
I need to write a script that will check a catch-all mailbox (pop3) and send a non delivery report back to the sender of the email. Background info: I have a domain hosted on a site that offers unlimited email accounts... the problem is, emails sent to an invalid address on the domain aren't automatically returned as non-deliverable. I am, however, able to set up a catch-all address and able to pick up those emails. Id like to set up a...
8
14299
by: rithish | last post by:
I am on IE 6. I was trying out a simple xmlhttp function that send GET/POST requests. However, IE throws an 'unspecified error' when I call the 'setRequestHeader' method. The function that I am trying out is give below. Am I doing something wrong? Any help is greatly appreciated. /*
1
10067
by: bobano | last post by:
Hi everyone, I am writing a POP3 Client program in Perl. You connect to a POP3 Server and have a running conversation with the mail server using commands from the RFC 1939 Post Office Protocol. This program can perform 5 options from a menu on your POP3 mail by logging in with the correct POP3 server along with a user name and password that you use to log in to your ISP. The user name and password as well as the server name are all hard-coded...
0
9625
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9459
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10056
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9920
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8944
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7466
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5365
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3618
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2857
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.