How can send mails using hotmail/rediffmail domain name?
I have used the below code to send a mail using javamail API?Even when I am sending my application does not have notified any of error/exceptions,But the message is not reached to I have given receipient's address in the to field.
import javax.mail.*;
import javax.mail.internet.*;
import javax.activation.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
import java.util.*;
public class Sendmail1 extends HttpServlet {
private String smtpHost;
// Initialize the servlet with the hostname of the SMTP server
// we'll be using the send the messages
public void init(ServletConfig config)
throws ServletException {
super.init(config);
smtpHost = config.getInitParameter("smtpHost");
//smtpHost = "sbm5501";
smtpHost = "www.rediffmail.com";
public void doGet(HttpServletRequest request,HttpServletResponse response)
throws ServletException, java.io.IOException {
String from = request.getParameter("from");
String to "[email protected]";
String cc = "[email protected]";
String bcc ="[email protected]";
String smtp ="www.rediffmail.com";
String subject = "hai";
String text = "Hai how r u";
PrintWriter writer = response.getWriter();
if (subject == null)
subject = "Null";
if (text == null)
text = "No message";
String status;
try {
// Create the JavaMail session
java.util.Properties properties = System.getProperties();
if (smtp == null)
smtp = "www.rediffmail.com";
properties.put("mail.smtp.host", smtp);
Session session = Session.getInstance(properties, null);
//to connect
//Transport transport =session.getTransport("smtp");
//transport.connect(smtpHost,user,password);
// Construct the message
MimeMessage message = new MimeMessage(session);
// Set the from address
Address fromAddress = new InternetAddress(from);
message.setFrom(fromAddress);
// Parse and set the recipient addresses
Address[] toAddresses = InternetAddress.parse(to);
message.setRecipients(Message.RecipientType.TO,toAddresses);
Address[] ccAddresses = InternetAddress.parse(cc);
message.setRecipients(Message.RecipientType.CC,ccAddresses);
Address[] bccAddresses = InternetAddress.parse(to);
message.setRecipients(Message.RecipientType.BCC,bccAddresses);
// Set the subject and text
message.setSubject(subject);
message.setText(text);
Transport.send(message);
//status = "<h1>Congratulations,</h1><h2>Your message was sent.</h2>";
} catch (AddressException e)
status = "There was an error parsing the addresses. " + e;
} catch (SendFailedException e)
status = "<h1>Sorry,</h1><h2>There was an error sending the message.</h2>" + e;
} catch (MessagingException e)
status = "There was an unexpected error. " + e;
// Output a status message
response.setContentType("text/html");
writer.println("<title>sendForm</title><body bgcolor= ><b><h3><font color=green><CENTER>CALIBERINFO.COM</CENTER></h3>Your message was sent to recepient(s).<br><font color=red>"+"\n"+to);
writer.println("<br><br><a href=e:/mail/javamail/mail.html>back to compose</a>");
writer.close();
Please any one help me out from this probs.
Awaiting for yours reply,
or give me a reply to: [email protected]
Regards,
@maheshkumar.k
Hi,
how can send mails using hotmail/rediffmail domain name?In your java application,you specified www.rediffmail.com as your
smtp server.But that is the address of that website.Try will a smtp
server instead.For a list of free smtp servers,please visit http://www.thebestfree.net/free/freesmtp.htm
Hope this helps.
Good Luck.
Gayam.Srinivasa Reddy
Developer Technical Support
Sun Microsystems
http://www.sun.com/developers/support/
Similar Messages
-
How can I find the currently logined domain name on Windows??
Dear,
I've a program that query some user account information from A.D.
But I don't want to hard code anything.
I've read some previous post about using LDAP, and using DNS queries to found all LDAP server of A.D.
But how can I get the A.D. domain name in Java?
for example
ldcp://_ldap._tcp.xxxx.yyyy
I want to get "xxxx.yyyy" from the logined user account. It is possible in Java.You coud use the NTSystem class to derive the NetBIOS domain name, however without doing some gymnastics it isn't easy to derive the fully qualified domain name. import java.io.*;
import com.sun.security.auth.module.NTSystem;
class NTDomain {
public static void main(String[] args) {
NTSystem system = new NTSystem();
String domain = system.getDomain();
System.out.println("Domain: " + domain);
}The only other alternatives could be to check the domain suffix of the user principal that was authenticated via Kerberos ....
lc = new LoginContext(searchkrb5.class.getName(),new SampleCallbackHandler());
lc.login();
catch (LoginException le) {
System.out.println("Logon failed: " + le);
System.exit(-1);
System.out.println("Authenticated via GSS-API");
System.out.println("User: " + lc.getSubject().getPrincipals().toString); however I think that you still have to specifify the Kerberos realm in the apps configuration file.
Another alternative could be to make assumptions about the machines hostname, however one day an assumption will always be proven wrong, (eg. The machine's DNS domain name does not need to match the Active Directory domain).
Unless there is a Java API to read the Windows registry or extract Kerberos ticket information from the WIndows Kerberos ticket cache, you may be kind of stuck. -
How to send mail using jsp program
am very new to jsp and doing my final year project. i need to send mails using my jsp program.can anyone say wht to do that is wht to include to send mails using jsp program. n also a sample code to send mail using jsp program.
Thanx in advanceUse below script.
<%@ page import="java.util.*, javax.mail.*, javax.mail.internet.*" %>
<%
Properties props = new Properties();
props.put("mail.smtp.host", "mailserver.com");
Session s = Session.getInstance(props,null);
InternetAddress from = new InternetAddress("[email protected]");
InternetAddress to = new InternetAddress([email protected]");
MimeMessage message = new MimeMessage(s);
message.setFrom(from);
message.addRecipient(Message.RecipientType.TO, to);
message.setSubject("Your subject");
message.setText("Your text");
Transport.send(message);
%>{code} -
Dear friends,
please send me code how to send bulk mails from bsp,
sincerely yoursHi Ganesh,
Look at the following two blogs by Thomas...This will surely help you..!
<a href="/people/thomas.jung3/blog/2004/09/07/sending-e-mail-from-abap--version-46d-and-lower--api-interface E-Mail from ABAP - Version 46D and Lower - API Interface</a>
and
<a href="/people/thomas.jung3/blog/2004/09/08/sending-e-mail-from-abap--version-610-and-higher--bcs-interface E-Mail from ABAP - Version 610 and Higher - BCS Interface</a>
This will surely help you.
<b><i>Do reward each useful answer..!</i></b>
Thanks,
Tatvagna. -
How can send mail without authentication
Hi all,
I am trying to send mail on gmail using java mail API.
It need to authenticate first, can anybody explain why it need to
authenticate .
Please Reply
Thanks in advance.
Amithttp://java.sun.com/products/javamail/FAQ.html#smtpauth
http://java.sun.com/products/javamail/javadocs/com/sun/mail/smtp/package-summary.html
Probably it will help.
Ramki -
Hi All
I am trying to set up James for an organization. I am able to send and recieve mails for only one particular domain(the organization domain) but I am not able to send or recieve mails from any other domain such as yahoo.com or gmail.com. Could anyone help me out.. Please. This is too urgent. Please help me out
thanks
srkpHi,
I think for that u need to take permission from ISP ( Internet service Provider).
Just check it. -
How can I make my homepage my domain name and not anything else?
I own my domain name and it is hosted with godaddy and everything is working fine except that when I go to http://www.mydomain.com it redirects to http://www.mydomain.com/1stiwebpage.html Is it possible to have my homepage (in this case 1stiwebpage) stay at www.mydomain.com or is it inevitable for it to redirect to what ever is the name of the top page in the iweb hierarchy. I hope this question makes sense. Thanks
The only way you can get this is to switch how you are forwarding. If you want www.mydomain.com then you would need to use masked web forwarding instead of CNAME. CNAME will show your site like this so that you can bookmark.
-
I have a new ipod and added all my apps to it. When I sign in to Words with Friends it says that "user name is already in use" because it is linked to my old ipod. How can I use the same user name with my new ipod?
Was the iPod setup via iTunes on this computer?
Setup via wifi?
Was the iPod previous synced to another iTunes library/computer?
Have you successfully synced from this iTunes library/computer before?
Do the songs play in iTunes?
Do you have the right boxes checked to sync?
iTunes: Syncing media content to iOS devices and iPod
Try syncing using the manual method -
How to send mail using HTML format using tags
Hello experts,
I am currently using FM SO_NEW_DOCUMENT_SEND_API1 to send e-mails to our users' Outlook accounts. Now, I converted its document type from 'RAW' to 'HTM'. I enclosed my texts in HTML tags. But the problem is, I cannot see a thing when I check my message in SCOT. It just opens internet explorer and thats it. Anyway, Below is my code:
get e-mail addresses of controllers in table ZSHIPTO_EMAIL
SELECT * FROM zshipto_email
INTO TABLE it_zshipto_email
WHERE zevent = '2'.
IF sy-dbcnt > 0.
IF NOT it_del_entries[] IS INITIAL.
CLEAR lv_contents.
maildata-obj_name = 'Record Deleted in table ZTS0001'.
maildata-obj_descr = 'Record Deleted in table ZTS0001'.
maildata-obj_langu = sy-langu.
records deleted in ZTS0001 and ZTS_STPGEOLOC
CLEAR: lv_flag, lv_counter.
LOOP AT it_zshipto_email.
CLEAR: it_del_entries, mailtxt.
LOOP AT it_del_entries ASSIGNING <fs_del_entries>.
get name of dealer
SELECT SINGLE name1 FROM kna1
INTO <fs_del_entries>-name1
WHERE kunnr = <fs_del_entries>-kunnr.
IF lv_counter IS INITIAL.
CONCATENATE: '<p>'
'FYI: The ff record/s were deleted in tables'
'ZTS0001 and ZTS_STPGEOLOC by user' sy-uname
'</p>'
INTO lv_contents
SEPARATED BY space.
mailtxt-line = lv_contents.
APPEND mailtxt.
CLEAR: mailtxt, lv_contents.
ENDIF.
APPEND mailtxt.
CONCATENATE: '<p>'
'Dealer :' <fs_del_entries>-kunnr '-'
<fs_del_entries>-name1 '</p>'
INTO lv_contents
SEPARATED BY space.
mailtxt-line = lv_contents.
APPEND mailtxt.
CLEAR: mailtxt, lv_contents.
CONCATENATE: '<p>'
'Ship-To:' <fs_del_entries>-cdseq '</p>'
INTO lv_contents
SEPARATED BY space.
mailtxt-line = lv_contents.
APPEND mailtxt.
CLEAR: mailtxt, lv_contents.
CONCATENATE: '<p>'
'Address:' <fs_del_entries>-zaddress '</p>'
INTO lv_contents
SEPARATED BY space.
mailtxt-line = lv_contents.
APPEND mailtxt.
CLEAR: mailtxt, lv_contents.
CONCATENATE: '<p>'
'Contact person:' <fs_del_entries>-zcperson
'</p>'
INTO lv_contents
SEPARATED BY space.
mailtxt-line = lv_contents.
APPEND mailtxt.
CLEAR: mailtxt, lv_contents.
CONCATENATE: '<p>'
'Contact number:' <fs_del_entries>-zcnumber
'</p>'
INTO lv_contents
SEPARATED BY space.
mailtxt-line = lv_contents.
APPEND mailtxt.
CLEAR: mailtxt, lv_contents.
lv_counter = 1.
ENDLOOP.
APPEND mailtxt.
mailrec-receiver = it_zshipto_email-zemail.
mailrec-rec_type = 'U'.
APPEND mailrec.
CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
EXPORTING
document_data = maildata
document_type = 'HTM'
put_in_outbox = 'X'
commit_work = 'X'
TABLES
object_header = mailtxt
object_content = mailtxt
receivers = mailrec
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
document_type_not_exist = 3
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
OTHERS = 8.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
CLEAR: mailtxt, mailrec, lv_counter.
REFRESH: mailtxt, mailrec.
ENDLOOP.
ENDIF.
Message was edited by: viraylabHi,
Check this...
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/5931ff64-0a01-0010-2bb7-ff2f9a6165a0
Regards
vijay -
How to send mail using transaction SBWP in HTML format?
Dear All,
When a mail is sent through SBWP transaction in HTML format,
it is finally displayed in text format with html tags, instead of being displayed in html format.
how to retain its HTML format?
Please suggest some solution.
Thanks in advance.Presuming you've already paired the bluetooth, just tap in the text box and you should see a cursor where you can start typing.
Beyond that, what are you seeing or not seeing? how is it acting? -
How to send mail using Java Server Pages(JSP)
Plz reply me the code for it
and send me mailmegha_bhagat82: You've posted 3 ill-defined questions in the wrong forum in 4 minutes on the day you registered: I suggest you take a very close look at http://www.catb.org/~esr/faqs/smart-questions.html ... I usually avoid posting that URL to often, as it can be considered rude, but I think in your case it's appropriate.
-
Sending mail using smtps protocol
Could anyone post a piece of code to show how to send a message using smtps protocol?
SSLNotes of 1.3.2ea version say that it's possibile, but i tried whithout success....
ThanksHello,
I can send the mail using SMTP with the help of java mail api. But i want to send mail using SMTPS protocol using java. The mail should be encrypted format.
So, my queries are:
1. How to send mail using SMTPS protocol?
2. I want to send the mail as encryption mail. So how to create encrypted mail.?
Thanks in advance.
From
Rajendra. -
Sending mails using dynamic actions
Hi
How we can send mails using dynamic actions.
Regards
SanthoshHi,
Sending mails is possible by using the feature M0001. This is to be coded in the dynamic action depending on the requirement with function code "M".
Hope this would help you to explore further. Incase of any specific query you can post back.
Regards
Tharak -
Send mail using Internal Mail server doesn't work
I can't send mail using my companies mail server, which requires authentication and port 587 to send. We have a valid, non self-signed SSL certificate so that is not the issue. I can send mail using Bell's mail server but that violates our regulatory compliance obligations.
The server using POP3 and one must login to get mail as well as send. Unfortunately there is no otehr error message than the: error sending "mail subject". No further details are provided and when we check the mail servers logs its clear the Pre isn't even attempting to connect to the mail server. So the request to send mail isn't even being sent out. That could be an issue with the Pre or with Bell but Bell support will only troubleshoot to the point of fidning out if you can send using their mail server. We can so their support stops at that point.
I still have v1.3.1 of the WebOS as v1.3.5 doesn't seem to be out for the Bell Pre's yet. But from what I've read v1.3.5 is even worse at handling mail not better. However, there may be a solution out there to this beyond sending the Pre's back (I doubt we can) as Balckberry's and iPhone's don't have this issue.
Any advice is greatly appreciated.
Post relates to: Pre p100eww (Bell)Further update on this problem. It does send if I use TLS instead of SSL so that must mean that the Palm Pre doesn't use SSLv3 or higher. As TLS is a viable security setting option to maintain compliance I can use that. But still Plam should seriously consider upgrading tis SSL versioning.
-
Cannot send mail to hotmail by webmail.
Out Mail server cannot send mail to hotmail by webmail(Sun Java System Messenger Express),but I can send mail to hotmail by microsoft outlook express.
I want to know why ?
Thanks!
(1) # ./imsimta version
Sun Java(tm) System Messaging Server 6.1 HotFix 0.11 (built Jan 28 2005)
libimta.so 6.1 HotFix 0.11 (built 16:16:35, Jan 28 2005)
SunOS jt-dns2 5.9 Generic_118558-08 sun4u sparc SUNW,Sun-Fire-280R
(2) mail.log_current by webmail:
11-Jan-2008 16:02:01.02 tcp_intranet tcp_local E 1 [email protected]
rfc822;[email protected] [email protected] lanps.com.cn ([127.0.0.1])
11-Jan-2008 16:02:03.01 tcp_local process E 1
rfc822;[email protected] [email protected] tcp-
daemon.mail1.lanps.com.cn
11-Jan-2008 16:02:03.01 tcp_local D 1 [email protected]
rfc822;[email protected] [email protected] mx1.hotmail.com dns;mx1.hotmail.com
(TCP|10.200.15.70|57281|65.54.245.8|25) smtp;250 [email protected]
11-Jan-2008 16:02:03.40 process ims-ms E 4
rfc822;[email protected] admin@ims-ms-daemon process-
daemon.mail1.lanps.com.cn
11-Jan-2008 16:02:03.40 process D 4
rfc822;[email protected] [email protected]
11-Jan-2008 16:02:03.60 ims-ms D 4
rfc822;[email protected] admin@ims-ms-daemon
(3) mail.log_current by outlook express:
11-Jan-2008 15:59:18.31 tcp_auth tcp_local EA 2 [email protected]
rfc822;[email protected] [email protected] CIT-BS1 ([10.0.33.58])
11-Jan-2008 15:59:18.46 tcp_local J 0 [email protected]
rfc822; [email protected] CIT-BS1 ([10.0.33.58]) 550 5.7.1 Relaying not allowed:
[email protected]
11-Jan-2008 15:59:19.83 tcp_local D 2 [email protected]
rfc822;[email protected] [email protected] mx4.hotmail.com dns;mx4.hotmail.com
(TCP|10.200.15.70|57277|65.54.244.104|25) smtp;250 [email protected]
Edited by: summer_ on Jan 11, 2008 12:36 AM
Edited by: summer_ on Jan 11, 2008 12:37 AM
(4) # ./configutil -o service.http.smtphost
# ./configutil -o service.http.smtphost
Edited by: summer_ on Jan 11, 2008 12:39 AM
Edited by: summer_ on Jan 11, 2008 12:51 AMsummer_ wrote:
We have a F5 Link Controller to test ,so I built a new SUN ONE test system.If this is a new installation then the problem could be anywhere, your installation/configuration and even this "F5 Link Controller" (whatever that is).
There are no error message to "[email protected]"
Well according to your logs an email message was delivered to the admin account.
hotmail did not get the mail.Log a support case (assuming you have a support contract). There is simply too many possible causes of your problem and the logs you provided contradict everything else you have said.
Regards,
Shane.
Maybe you are looking for
-
I earlier had a java 1.7 installed in my system. I wanted to revert the version back to 1.6. I downloaded the file JavaForOSX2014-001.dmg and installed it in my hard disk. I am not sure where it has installed it but it has successfully done it. W
-
HT4352 how can I add an additional apple tv to my computer
How can I add an aditional apple tv to my computer and my remote on my phone?
-
Flash to flash paper (losing effect)
When I export a flash file to flashpaper, I loose all of the effects (shadow, bevel, etc). What am I doing wrong? thanks!
-
Dear All, I have installed EP 7.0 and ESS business packages now i am confused about logging on to ESS, can anyone please provide me with a sample URL which i need to use to log on to the ESS or to the Portal. regards Vinay
-
Hi All, My machine has been crashed, I was using windows O/S , I never took any type of backup i.e. Import/ Export or RMAN. All I have right now copy of ORADATA folder. Now I installed windows again and I want to recover my databases from ORADATA fol