Sending Mail from a class
Hello everyone,
I have recently been trying to send mail from an ecommerce application, i attempted to use the javax.mail and javax.mail.internet packages, i have however come to believe theese have been depreciated, i have looked in the 1.4 api docs but cannot find anything on mail could someone please tell me which classes, package or api i should use
thanks for your time
Arnold Oree
separate package:
http://java.sun.com/products/javamail/
Similar Messages
-
Changing Sender Details in Sending mails from SAP
Hi All,
I am getting request from legacy system to send mail from along with document. So i am creating the document and attaching that to send request then the system automatically taking the user login eamil ID as sender Email ID.But My requirement is i have to change the sender email ID as the what ever the email ID i got from legacy system.
In this i am using class :: CL_SAPUSER_BCS
Please help me if any implemented this earlier.
Thanks
Anil dI am using object oriented approach and this is my modified code
Intially SAP using the following code
Sender details; Usually user name
WA_SENDER0 = CL_SAPUSER_BCS=>CREATE( SY-UNAME ).
call method WA_SENDREQ->SET_SENDER
exporting
I_SENDER = WA_SENDER0.
but i hv commented this one and added my code.then also i can't able to send mails from this class.
V_SENDER = 'abc.yahoo.com'.
data: SENDER type ref to CL_CAM_ADDRESS_BCS.
SENDER = CL_CAM_ADDRESS_BCS=>CREATE_INTERNET_ADDRESS( V_SENDER ).
call method WA_SENDREQ->SET_SENDER
exporting
I_SENDER = SENDER.
Thanks -
Sending mail from servers with non-ASCII names
As part of an effort to internationalize our product we're testing on machines with host names that include non-ASCII characters (accented e's and whatnot). When trying to send mail from these machines we're getting:
javax.mail.MessagingException: 501 5.5.4 Invalid Address
at com.sun.mail.smtp.SMTPTransport.issueCommand(SMTPTransport.java:1634)
at com.sun.mail.smtp.SMTPTransport.helo(SMTPTransport.java:1068)
at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:458)
at javax.mail.Service.connect(Service.java:291)
at javax.mail.Service.connect(Service.java:172)
at javax.mail.Service.connect(Service.java:121)
at javax.mail.Transport.send0(Transport.java:190)
at javax.mail.Transport.send(Transport.java:120)
at msgsendsample.main(msgsendsample.java:86)
Looking at a network trace I see the EHLO command being sent as
EHLO test[0xe9][0xdf]\r\n
where the machine name is testéß. From a Unicode table 0xe9 0xdf = é ß.
I found a reference from RFC 5336 (SMTP Extension for Internationalized Email Addresses) that says the hostname in the EHLO must be in the form of ACE (ASCII-compatible encoding) labels:
3.7.1. The Initial SMTP Exchange
When an SMTP connection is opened, the server normally sends a
"greeting" response consisting of the 220 response code and some
information. The client then sends the EHLO command. Since the
client cannot know whether the server supports UTF8SMTP until after
it receives the response from EHLO, any domain names that appear in
this dialogue, or in responses to EHLO, MUST be in the hostname form,
i.e., internationalized ones MUST be in the form of ACE labels.
ACE encoding for my machine would be: java.net.IDN.toASCII("test4éß") --> "xn--testss-eva".
I'm not sure if this RFC applies in this case - I didn't know anything about the guts of SMTP until yesterday - but it makes sense that you'd need to escape the hostname in the EHLO until you can negotiate capabilities.
Looking at the JavaMail API it seems that if I were to call SMTPTransport.helo(String domain) myself without going through the higher-level Transport class that maybe I could work around the issue, but I haven't looked into it enough to know if that's feasible.
Is anyone familiar with this problem? I'm using JavaMail 1.4.2 on Windows 2003 and Exchange as my SMTP server.
thanks,
EricSame problem here (or at least in part). Some .mac folders did no longer show any messages, while they were there and could be seen online and with Thunderbird. After your remark I changed the name of a folder which contained a "´" and now it works. It is really strange because there is another folder with a "¨" in it which does not work (I will test if the name change works with this folder as well in a minute) whilst there is another one with such name which works fine. The update really messed up Mail and in Dutch we just use such characters so Mail without supporting them will be rather useless for me...
-
Geting exception whiel sending mail from OIM
Hi,
Currently we are using Exchange 2010 and our OIM version is 9.1.0. We have written custom code for Exchange provisioning. We have migrated the admin account, through which OIM sends out mail, to Exchange 2010. We are trying to create new OIM user in IDM. We have a custom code which sends out mail to supervisor when a new contractor is created in IDM. Whiel sending mail from that admin account to supervsior we get this below error:
ERROR,08 Nov 2012 00:03:28,026,[XELLERATE.REQUESTS],Class/Method: tcEmailNotificationUtil/sendEmail encounter some problems: Sending failed;
nested exception is:
class javax.mail.MessagingException: xxx x.x.x Client was not authenticated
javax.mail.SendFailedException: Sending failed;
nested exception is:
class javax.mail.MessagingException: xxx x.x.x Client was not authenticated
at javax.mail.Transport.send0(Transport.java:218)
at javax.mail.Transport.send(Transport.java:80)
at com.thortech.xl.dataobj.util.tcEmailNotificationUtil.sendEmail(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
Please help us on this. Is firewall a issue as exchange server is installed on some other remote server?
Thanks.
Edited by: user11957197 on 8 Nov, 2012 1:15 AMI resolved this issue by using tcEmailNotificationUtil instead of other API
In the Adapter's Java Code, I read values from "Email Server" IT Resource and my custom Email Template definition...by using tcITResourceOperationsIntf and tcEmailDefinitionOperationsIntf)
Then by using OOTB class found in mail.jar and xlDataObjects.jar, I sent the mail..
By using OOTB class found in mail.jar and xlDataObjects.jar, I sent the mail..
import com.thortech.xl.dataobj.util.tcEmailNotificationUtil;
tcEmailNotificationUtil emailNotificationUtil = new tcEmailNotificationUtil(dataProvider);
emailNotificationUtil.constructEmail(emailTemplateName);
emailNotificationUtil.sendEmail(toEmailAddress); -
Hi, i am trying to send mail from database i have create a database in mysql and the program will retreive the email and send it to the person.
I have set the classpath in my window 98.
But still cannot run
Below is my source code;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.sql.*;
import java.util.*;
import javax.mail.*;
import javax.mail.internet.*;
import java.net.*;
import java.text.*;
import java.io.*;
public class Emailer
public static void sendMessage( String title,
String email1,String email2, String message1)
throws Exception
try
String host = "192.9.201.28";
Properties props = new Properties();
props.put("mail.smtp.host", host);
Session session = Session.getInstance(props, null);
Message msg = new MimeMessage(session);
InternetAddress [] address = null;
address = InternetAddress.parse(email1);
InternetAddress [] ccaddress = null;
ccaddress = InternetAddress.parse(email2);
String mailsenderaddr = "[email protected]";
msg.setFrom(new InternetAddress(mailsenderaddr));
msg.setRecipients(Message.RecipientType.TO, address);
System.out.println(email1);
msg.setRecipients(Message.RecipientType.BCC, ccaddress);
System.out.println(email2);
msg.setSubject(title);
System.out.println(title);
msg.setSentDate(new java.util.Date());
msg.setText(message1);
System.out.println(message1);
Transport.send(msg);
System.out.println("Mesage Send");
catch (MessagingException mex)
System.out.println("msg err:"+mex);
public static void main(String[] argv) throws Exception
try {
System.out.println("Loading Driver (with Class.forName)");
Class.forName ("org.gjt.mm.mysql.Driver");
System.out.println("Getting Connection");
Connection conn = DriverManager.getConnection (
"jdbc:mysql://192.9.201.40/test?user=testid&password=testpwd"); // user, passwd
System.out.println("Creating Statement");
Statement stmt = conn.createStatement();
System.out.println("Executing Query");
ResultSet rs = stmt.executeQuery("SELECT * FROM Reminder where Date_Remind='20050406'");
System.out.println("Retrieving Results");
int i = 0;
while (rs.next()) {
String title = rs.getString("Title");
String message1 = rs.getString("Message");
String date_remind = rs.getString("Date_Remind");
String email1 = rs.getString("Email1");
String email2= rs.getString("Email2");
System.out.println("ROW " + ++i + ": " +
title + "; " message1 ";" + date_remind + "; " + email1+ ";" + email2+ ";");
sendMessage ( title, email1,email2, message1);
rs.close(); // All done with that resultset
stmt.close(); // All done with that statement
conn.close(); // All done with that DB connection
} catch (ClassNotFoundException e) {
System.out.println("Can't load driver " + e);
} catch (SQLException e) {
System.out.println("Database access failed "+ e);
But there are still error in the following:
msg error: javax.mail.NoSuchProviderException: No provider for SMTP
Please help..
Thank youCan you print the error message your getting. Are you able to print date_reminder, email1, email2 from your db.
-
Send mail from Portal application using java
Hi everybody,
I'm looking for a way to send mails from my portal application written in java.
Now I've read a lot of topics on this but can't seem to get it straight.
I added a few jars to my project among which is
coll.appl.gw.srvcmail_api.jar
Here you have the ISendMailItem.class and ISendMailService.class files.
Now I know these are interfaces so I created 2 new classes:
Mail implementing ISendMailItem
SendMail implementing ISendMailService
And all of the forced methods are created for me but now I don't know how to use these classes to be able to send a mail.
Can someone help me with this please?
Thank you
Regards
WouterHey Göran,
Thank you for this example.
for the transport i've put this
transport.connect( "smtpgateway.arinso.com", "", "" );
Is this correct? or do I need to fill in more info?
I've adde the mail.jar to my buildpath and put your code in a eventhandler.
When I now generate the corresponding event i get an Exception:
java.lang.ClassCastException: javax.mail.Session
Do you know why I get this?
Thank you
Wouter
Message was edited by:
Wouter Delellio -
Problem sending mail from within C#
Sorry, I am posting this question for the second time !!!!
I have constructed a snippet that sends mail from within C#.In My script, there are will be several receivers of my mail. The script will read from a file, mail addresses and send mail to each individual contained in the file. As test I run the script with
two mail addresses in the file,one my own and the second with outlook mail. However, the result is I get the mail but the second receiver never gets it.
What is the problem ????
Please help
I debugged the program and verified that Nsmtp and Mailreceiver are correct
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Net;
using System.Net.Mail;
using System.Net.Mime;
using System.Text;
using System.Windows.Forms;
namespace Note_Pss
public partial class Email : Form
public Note_Pss.Form1 m_parent;
Util util = new Util(); string signal = "#";
char g = System.Convert.ToChar("*");
char X = System.Convert.ToChar("@");
Utility_Types utility_type = new Utility_Types(); string P = "";
char p; String Mailsender; String Npass; String Nsmtp;
String Mailreceiver; String Mailbody; String MailTitle;
MailMessage mail = new MailMessage();
public Email(Note_Pss.Form1 parent)
InitializeComponent();
m_parent = parent;
string ListContent = util.openf(wsk.storagedbase + @"\TemFile");
wsk.listArray = util.arrayadjust(ListContent, signal);
private void multi_mail_Send()
{char g = System.Convert.ToChar("*");
MailParameters();
int Count_num = wsk.listArray.Count;
for (int i = 0; i < Count_num; i++)
string P = wsk.listArray[i].ToString();
string[] Sub_File = P.Split(g);
Mailreceiver = Sub_File[2].ToString();
Nsmtp = "smtp."+msmtp_name(Mailreceiver, "@");
Send_Mail();
//if (Enclosure.Text != "") MailAttachment();
//MailBody();
private String msmtp_name(string p, string p_2)
string P = p.ToString();
string[] Pp = P.Split(X);
string bbb = Pp[1];
return bbb;
private void MailParameters()
Mailsender = Sender.Text;
Npass = Senderpass.Text;
Mailbody = Body.Text;
MailTitle = Subject.Text;
private void Send_Mail()
try
MailMessage mail = new MailMessage();
SmtpClient client = new SmtpClient();
client.Port = 587;
client.Host = Nsmtp;
mail.From = new MailAddress(Mailsender);
mail.To.Add(Mailreceiver);
mail.Subject = MailTitle;
mail.Body = Mailbody;
textBox1.Text = Nsmtp + " " + Mailreceiver;
client.DeliveryMethod = SmtpDeliveryMethod.Network;
client.UseDefaultCredentials = false;
client.Credentials = new System.Net.NetworkCredential(Mailsender, Npass);
client.EnableSsl = true;
client.Send(mail);
catch (Exception ex) { textBox1.Text = ex.ToString(); }
private void MailSend_Click(object sender, EventArgs e)
{ multi_mail_Send(); }
private void button2_Click(object sender, EventArgs e)
{ Enclosure.Text = util.openImage();}
private void button1_Click(object sender, EventArgs e)
this.Close();Nsmtp and Mailreceiver are verified through debugging:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Net.Mail;
using System.Net.Mime;
using System.Net;
namespace Note_Pss
public partial class Email : Form
public Note_Pss.Form1 m_parent;
Util util = new Util(); string signal = "#";
char g = System.Convert.ToChar("*");
char X = System.Convert.ToChar("@");
Utility_Types utility_type = new Utility_Types(); string P = "";
char p; String Mailsender; String Npass; String Nsmtp;
String Mailreceiver; String Mailbody; String MailTitle;
MailMessage mail = new MailMessage();
public Email(Note_Pss.Form1 parent)
InitializeComponent();
m_parent = parent;
string ListContent = util.openf(wsk.storagedbase + @"\TemFile");
wsk.listArray = util.arrayadjust(ListContent, signal);
private void multi_mail_Send()
char g = System.Convert.ToChar("*");
MailParameters();
int Count_num = wsk.listArray.Count;
for (int i = 0; i < Count_num; i++)
string P = wsk.listArray[i].ToString();
string[] Sub_File = P.Split(g);
Mailreceiver = Sub_File[2].ToString();
Nsmtp = "smtp." + msmtp_name(Mailreceiver, "@");
Send_Mail();
//if (Enclosure.Text != "") MailAttachment();
//MailBody();
private String msmtp_name(string p, string p_2)
string P = p.ToString();
string[] Pp = P.Split(X);
string bbb = Pp[1];
return bbb;
private void MailParameters()
Mailsender = Sender.Text;
Npass = Senderpass.Text;
Mailbody = Body.Text;
MailTitle = Subject.Text;
private void Send_Mail()
try
MailMessage mail = new MailMessage();
SmtpClient client = new SmtpClient();
client.Port = 587;
client.Host = Nsmtp;
mail.From = new MailAddress(Mailsender);
mail.To.Add(Mailreceiver);
mail.Subject = MailTitle;
mail.Body = Mailbody;
//SmtpServer.Port = 25;
//textBox1.Text = Nsmtp + " " + Mailreceiver;
client.DeliveryMethod = SmtpDeliveryMethod.Network;
client.UseDefaultCredentials = false;
client.Credentials = new System.Net.NetworkCredential(Mailsender, Npass);
client.EnableSsl = true;
client.Send(mail);
// MessageBox.Show("mail Send");
catch (Exception ex) { }
private void MailSend_Click(object sender, EventArgs e)
{ multi_mail_Send(); }
private void button2_Click(object sender, EventArgs e)
{ Enclosure.Text = util.openImage(); }
private void button1_Click(object sender, EventArgs e)
this.Close(); -
How can i send mails from SAP?
how can i send mails from SAP?
what are the configurations i have to do in SAP for that?
pls give me a detail reply......
if possible, pls give me the sample ABAP program for that.recently i have worked on a similar requirement here is the sample code for that
REPORT ZDOC_AS_EMAIL_3.
*& Report ZEMAIL_ATTACH *
*& Example of sending external email via SAPCONNECT *
TABLES: ekko.
PARAMETERS: p_email TYPE somlreci1-receiver.
TYPES: BEGIN OF t_ekpo,
ebeln TYPE ekpo-ebeln,
ebelp TYPE ekpo-ebelp,
aedat TYPE ekpo-aedat,
matnr TYPE ekpo-matnr,
END OF t_ekpo.
DATA: it_ekpo TYPE STANDARD TABLE OF t_ekpo INITIAL SIZE 0,
wa_ekpo TYPE t_ekpo.
TYPES: BEGIN OF t_charekpo,
ebeln(10) TYPE c,
ebelp(5) TYPE c,
aedat(8) TYPE c,
matnr(18) TYPE c,
END OF t_charekpo.
DATA: wa_charekpo TYPE t_charekpo.
DATA: it_message TYPE STANDARD TABLE OF solisti1 INITIAL SIZE 0
WITH HEADER LINE.
DATA: it_attach TYPE STANDARD TABLE OF solisti1 INITIAL SIZE 0
WITH HEADER LINE.
DATA: l_t_objhead LIKE solisti1 OCCURS 1 WITH HEADER LINE.
DATA: t_packing_list LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE,
t_contents LIKE solisti1 OCCURS 0 WITH HEADER LINE,
t_receivers LIKE somlreci1 OCCURS 0 WITH HEADER LINE,
t_attachment LIKE solisti1 OCCURS 0 WITH HEADER LINE,
t_object_header LIKE solisti1 OCCURS 0 WITH HEADER LINE,
w_cnt TYPE i,
w_sent_all(1) TYPE c,
w_doc_data LIKE sodocchgi1,
gd_error TYPE sy-subrc,
gd_reciever TYPE sy-subrc.
*START_OF_SELECTION
START-OF-SELECTION.
*Retrieve sample data from table ekpo
PERFORM data_retrieval.
*Populate table with detaisl to be entered into .xls file
PERFORM build_xls_data_table.
*END-OF-SELECTION
END-OF-SELECTION.
*Populate message body text
perform populate_email_message_body.
*Send file by email as .xls speadsheet
PERFORM send_file_as_email_attachment
tables it_message
it_attach
using p_email
'Example . xls documnet attachment'
'XLS'
'filename'
changing gd_error
gd_reciever.
*Instructs mail send program for SAPCONNECT to send email(rsconn01)
PERFORM initiate_mail_execute_program.
*& Form DATA_RETRIEVAL
*Retrieve data form EKPO table and populate itab it_ekko
FORM data_retrieval.
SELECT ebeln ebelp aedat matnr
UP TO 10 ROWS
FROM ekpo
INTO TABLE it_ekpo.
ENDFORM. " DATA_RETRIEVAL
*& Form BUILD_XLS_DATA_TABLE
*Build data table for .xls document
FORM build_xls_data_table.
*CONSTANTS: con_cret(2) TYPE c VALUE '0D', "OK for non Unicode
*con_tab(2) TYPE c VALUE '09'. "OK for non Unicode
*If you have Unicode check active in program attributes thnen you will
*need to declare constants as follows
class cl_abap_char_utilities definition load.
constants:
con_tab type c value cl_abap_char_utilities=>HORIZONTAL_TAB,
con_cret type c value cl_abap_char_utilities=>CR_LF.
CONCATENATE 'EBELN' 'EBELP' 'AEDAT' 'MATNR'
INTO it_attach SEPARATED BY con_tab.
CONCATENATE con_cret it_attach INTO it_attach.
APPEND it_attach.
LOOP AT it_ekpo INTO wa_charekpo.
CONCATENATE wa_charekpo-ebeln wa_charekpo-ebelp
wa_charekpo-aedat wa_charekpo-matnr
INTO it_attach SEPARATED BY con_tab.
CONCATENATE con_cret it_attach INTO it_attach.
APPEND it_attach.
ENDLOOP.
ENDFORM. " BUILD_XLS_DATA_TABLE
*& Form SEND_FILE_AS_EMAIL_ATTACHMENT
*Send email
FORM send_file_as_email_attachment tables pit_message
pit_attach
using p_email
p_mtitle
p_format
p_filename
p_attdescription
p_sender_address
p_sender_addres_type
changing p_error
p_reciever.
DATA: ld_error TYPE sy-subrc,
ld_reciever TYPE sy-subrc,
ld_mtitle LIKE sodocchgi1-obj_descr,
ld_email LIKE somlreci1-receiver,
ld_format TYPE so_obj_tp ,
ld_attdescription TYPE so_obj_nam ,
ld_attfilename TYPE so_obj_des ,
ld_sender_address LIKE soextreci1-receiver,
ld_sender_address_type LIKE soextreci1-adr_typ,
ld_receiver LIKE sy-subrc.
ld_email = p_email.
ld_mtitle = p_mtitle.
ld_format = p_format.
ld_attdescription = p_attdescription.
ld_attfilename = p_filename.
ld_sender_address = p_sender_address.
ld_sender_address_type = p_sender_addres_type.
*Fill the document data.
w_doc_data-doc_size = 1.
*Populate the subject/generic message attributes
w_doc_data-obj_langu = sy-langu.
w_doc_data-obj_name = 'REPORT'.
w_doc_data-obj_descr = ld_mtitle . "mail description
w_doc_data-sensitivty = 'F'.
*Fill the document data and get size of attachment
CLEAR w_doc_data.
READ TABLE it_attach INDEX w_cnt.
w_doc_data-doc_size =
( w_cnt - 1 ) * 255 + STRLEN( it_attach ).
w_doc_data-obj_langu = sy-langu.
w_doc_data-obj_name = 'SAPRPT'.
w_doc_data-obj_descr = ld_mtitle.
w_doc_data-sensitivty = 'F'.
CLEAR t_attachment.
REFRESH t_attachment.
t_attachment[] = pit_attach[].
*Describe the body of the message
CLEAR t_packing_list.
REFRESH t_packing_list.
t_packing_list-transf_bin = space.
t_packing_list-head_start = 1.
t_packing_list-head_num = 0.
t_packing_list-body_start = 1.
DESCRIBE TABLE it_message LINES t_packing_list-body_num.
t_packing_list-doc_type = 'RAW'.
APPEND t_packing_list.
*Create 1st attachment notification
t_packing_list-transf_bin = 'X'.
t_packing_list-head_start = 0.
t_packing_list-head_num = 1.
t_packing_list-body_start = 1.
DESCRIBE TABLE t_attachment LINES t_packing_list-body_num.
t_packing_list-doc_type = ld_format.
t_packing_list-obj_descr = ld_attdescription.
t_packing_list-obj_name = ld_attfilename.
t_packing_list-doc_size = t_packing_list-body_num * 255.
APPEND t_packing_list.
**Create 1st attachment notification
*t_packing_list-transf_bin = 'X'.
*t_packing_list-head_start = 0.
*t_packing_list-head_num = 1.
*t_packing_list-body_start = 1.
*DESCRIBE TABLE t_attachment LINES t_packing_list-body_num.
*t_packing_list-doc_type = ld_format.
*t_packing_list-obj_descr = ld_attdescription.
*t_packing_list-obj_name = ld_attfilename.
*t_packing_list-doc_size = t_packing_list-body_num * 255.
*APPEND t_packing_list.
**Create 2nd attachment notification
data: x type i.
DESCRIBE TABLE t_attachment LINES X.
append lines of it_attach to t_attachment.
data: start type i,
end type i,
cal type i.
start = X + 1.
describe table t_attachment lines end.
cal = end - start.
t_packing_list-transf_bin = 'X'.
t_packing_list-head_start = 0.
t_packing_list-head_num = 1.
t_packing_list-body_start = start.
t_packing_list-body_num = end.
*DESCRIBE TABLE t_attachment LINES t_packing_list-body_num.
t_packing_list-obj_descr = 'Eng Change'. "ld_attdescription.
t_packing_list-doc_type = ld_format.
*t_packing_list-obj_name = 'Eng' .
t_packing_list-doc_size = t_packing_list-body_num * 255.
APPEND t_packing_list.
*Add the recipients email address
CLEAR t_receivers.
REFRESH t_receivers.
t_receivers-receiver = ld_email.
t_receivers-rec_type = 'U'.
t_receivers-com_type = 'INT'.
t_receivers-notif_del = 'X'.
t_receivers-notif_ndel = 'X'.
APPEND t_receivers.
CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
EXPORTING
document_data = w_doc_data
put_in_outbox = 'X'
sender_address = ld_sender_address
sender_address_type = ld_sender_address_type
commit_work = 'X'
IMPORTING
sent_to_all = w_sent_all
TABLES
packing_list = t_packing_list
object_header = l_t_objhead
contents_bin = t_attachment
contents_txt = it_message
receivers = t_receivers
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.
*Populate zerror return code
ld_error = sy-subrc.
*Populate zreceiver return code
LOOP AT t_receivers.
ld_receiver = t_receivers-retrn_code.
ENDLOOP.
ENDFORM.
*& Form INITIATE_MAIL_EXECUTE_PROGRAM
*Instructs mail send program for SAPCONNECT to send email.
FORM initiate_mail_execute_program.
WAIT UP TO 2 SECONDS.
SUBMIT rsconn01 " WITH mode = 'INT'
"WITH output = 'X'
AND RETURN.
ENDFORM. " INITIATE_MAIL_EXECUTE_PROGRAM
*& Form POPULATE_EMAIL_MESSAGE_BODY
*Populate message body text
form populate_email_message_body.
REFRESH it_message.
it_message = 'Please find attached a list test ekpo records'.
APPEND it_message.
endform. " POPULATE_EMAIL_MESSAGE_BODY -
I am trying to send mail from the database and get the following
error. How do I make sure that the class mentioned in the error
message is installed properly in the database? The db ver is
8.1.7.
SQL> exec send_mail_tcp
(msg_to=>'[email protected]' ,msg_text=>'Message from db');
BEGIN send_mail_tcp
(msg_to=>'[email protected]' ,msg_text=>'Message from db'); END;
ERROR at line 1:
ORA-29540: class oracle/plsql/net/TCPConnection does not exist
ORA-06512: at "SYS.UTL_TCP", line 537
ORA-06512: at "SYS.UTL_TCP", line 199
ORA-06512: at "ADSL.SEND_MAIL_TCP", line 10
ORA-06512: at line 1The most likely explanation os because the Jserver is not
installed properly. Some versions of the script didn't call
initplsj.sql so try running this manually (as SYS) - it's in the
$ORACLE_HOME/rdbms*/admin directory. If that doesn't solve your
problem trying using loadjava to load plsql.jar.
rgds, APC -
Error during sending mail from solaris 9
Hi All,
I am trying to send mail from solaris machine.I am using sendmail 8.12.9+Sun.When I am trying to send mail a mail using
#echo "Test mail"|mailx -s "welcome to Solaris" [email protected]
#it is execuitng sucessfully but when I am seeing the /var/log/syslog file,then It showing the error--
/etc/mail/aliases.db out of date
Aug 6 15:51:33 mgsun sendmail[823]: [ID 801593 mail.notice] n76ALXfa000823: <Sang@mgsun>... User unknown
Aug 6 15:51:33 mgsun sendmail[813]: [ID 801593 mail.info] n76ALXZo000813: to=Sang, delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=31096, relay=[127.0.0.1] [127.0.0.1], dsn=5.1.1, stat=User unknown
00823: from=<>, size=1096, class=0, nrcpts=0, proto=ESMTP, daemon=MTA, relay=localhost [127.0.0.1]
00813: n76ALXZp000813: return to sender: User unknown
Aug 6 15:51:33 mgsun sendmail[823]: [ID 801593 mail.info] n76ALXfc000823: from=<>, size=3566, class=0, nrcpts=1, msgid=<200908061021.n76ALXZp000813@mgsun>, proto=ESMTP, daemon=MTA, relay=localhost [127.0.0.1]
Aug 6 15:51:33 mgsun sendmail[813]: [ID 801593 mail.info] n76ALXZp000813: to=postmaster, delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=32120, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (n76ALXfc000823 Message accepted for delivery)
Aug 6 15:51:33 mgsun sendmail[824]: [ID 702911 mail.info] alias database /etc/mail/aliases.db out of date
Aug 6 15:51:33 mgsun sendmail[824]: [ID 801593 mail.info] n76ALXfc000823: to=root, delay=00:00:00, xdelay=00:00:00, mailer=local, pri=33739, dsn=5.3.0, stat=unknown mailer error 5
Aug 6 15:51:33 mgsun sendmail[824]: [ID 801593 mail.info] n76ALXfc000823: n76ALXfY000824: postmaster notify: unknown mailer error 5
Aug 6 15:51:33 mgsun sendmail[824]: [ID 801593 mail.info] n76ALXfY000824: to=root, delay=00:00:00, xdelay=00:00:00, mailer=local, pri=31024, dsn=5.3.0, stat=unknown mailer error 5
Aug 6 15:51:33 mgsun sendmail[824]: [ID 801593 mail.info] n76ALXfY000824: n76ALXfZ000824: return to sender: unknown mailer error 5
Aug 6 15:51:33 mgsun sendmail[824]: [ID 801593 mail.info] n76ALXfZ000824: to=root, delay=00:00:00, xdelay=00:00:00, mailer=local, pri=31024, dsn=5.3.0, stat=unknown mailer error 5
Aug 6 15:51:33 mgsun sendmail[824]: [ID 801593 mail.alert] n76ALXfY000824: Losing ./qfn76ALXfY000824: *savemail panic*
Aug 6 15:51:33 mgsun sendmail[824]: [ID 801593 mail.crit] n76ALXfY000824: SYSERR(root): s*avemail: cannot save rejected email anywhere*Please help me to resolve it.
Thanks in advance..Here's some pointers on troubleshooting sendmail:
[http://docs.hp.com/en/B2355-90110/ch05s08.html]
and
qualify my own domain
[http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=149991]
newaliases error - Executable files not allowed
[http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=39966]
HP forums can be good for SUN too. :) -
Cannot send mail from mac mail or Entourage
Hi guys,
Wondered if anyone out there can shed some light on this little problem.
I use Entourage for my emails & all was working fine until yesterday. I can receive mail from all and sundry but I can't send anything. I subscribe to ntlworld internet service and if log onto my email through their webmail, then it's fine. I've tried sending mail from mac mail and I get the same problem. I've been onto microsoft support & gone through all the troubleshooting with Entourage. The Entourage techy suggested it was my internet provider blocking my emails as they think I'm a spammer?? I phoned ntl & they insist it's nothing to do with them as I can send/receive from the website. (If I send an email with the address @ntlworld it's fine, but any other address i.e. all my clients/mates etc just stays in my outbox.
Nothing on any of my settings has changed so I'm at a loss what to do next.
Any suggestions greatly appreciated.
Thanks, Melit may be that your server (internet provider) has just started blocking outgoing mails not authenticated by them.
Go to your account set up...
and fill in the following details.
SMTP SERVER: smtp.mac.com
then click on advanced sending otions...
click on override default SMTP port... type 587
click on SMTP servber requires authentication...
use same setting as receiving mail server.
try this... -
I cannot send mails from my ipad, I have checked settings with my mail server and they tell me that everything is OK, they don't know what may be causing the problem, any ideas?
TBS2.
There is no way for anyone to know if your problem is identical to the problem reported by maria_diaz. She didn't mention anything about getting the "relaying" message. I suggest you start a new question that gives a good title to a specific problem. Then in the body of the thread describe the problem in detail, tell us what steps you have tried so far to correct the problem, what happened, and what error messages you received. -
Cannot send mail from any mail account
I have a Mac Mini, late 2014 model, running OS X Yosemite version 10.10.2. I have constant difficulty sending mail from any of my mail accounts; these are iCloud, Googlemail, Yahoo and a personal one which uses 123-reg.co.uk. I am currently located in Greece, but have been having trouble for ages, even in the UK. I can receive mail, but I don't seem able to send it. Error message is usually simply cannot send mail using this server, select a different server. However, when connection doctor is run, all servers appear to be connected and I am logged in. Any ideas please?
rosiehwilson wrote:
Hi, not sure why that is relevant, but we arrived at the end of January this year. Here is a screen shot of a recurring problem, although in this case Gmail is not connected to the internet, which it usually is. Hope this helps.
Your outgoing Gmail servers not working, everything else seems OK.
So, what is not working for you (other than Gmail Sending) -
Unable to send Mail from POP account
I have an Iphone 4 and have upgraded the IOS from 5-1 to 6.1.3. Since then I have been receiving all my mails but i have been unable to send mails from my POP account. the notification "Cannot Send Mail. A copy has been placed in your Outbox. The receipient, "xxyyzz @ gmail . com " was rejected by the server" displayed. Please Help. the same thing happens when I configure my POP account on my Son's Iphone4, and there is no problem in receiving and sending mails from my Outlook. Please Help!!!!!
Can i revert back to IOS5.1.1?????Contact your email provider and get the correct settings to use for the outgoing mail server (SMTP) on a mobile device. If it's email provided by your ISP, they have likely blocked email from outside their network from relaying to prevent spam.
-
Cannot send mail from .mac account in Entourage
I am a new mac user so my troubleshooting skills are very weak. Until about one week ago, i was able to send mail from both my hotmail account and my .mac account. Now, i get this error (just on my .mac account):
An operation on the server timed out. The server may be down, overloaded, or there may be too much net traffic.
i read through much of the support articles, but did not find my specific error. can anyone help??
thank you
mknz
MacBook Pro Mac OS X (10.4.7) new mac user
MacBook Pro Mac OS X (10.4.7) new mac userit may be that your server (internet provider) has just started blocking outgoing mails not authenticated by them.
Go to your account set up...
and fill in the following details.
SMTP SERVER: smtp.mac.com
then click on advanced sending otions...
click on override default SMTP port... type 587
click on SMTP servber requires authentication...
use same setting as receiving mail server.
try this...
Maybe you are looking for
-
I am having a problem opening an important PDF portfolio document using Adobe Reader (version 11.0.02) for Mac (Mountain Lion version 10.8.3). When I attempt to open the file, I come up with the error message: "For the best experience, open this PDF
-
Multiple subtitles in Web Gallery
I have 5 albums in Aperture. When I create a web gallery, I want show each album with a sepearte subtitle. How can I do that ? Appreciate any help.
-
Cannot update Acrobat Professional 9.0.0
My situation: I have bought Adobe Acrobat Pro (version 8) for Max OSX and later on bought an update to version 9 (Acrobat Professional). However I am unable to update the software as I keep on receiving the message that the software is not in it's or
-
Why can't i log into my iMessage
Cant log into my imessage or facetime, server difficulties keeps appearing, anyone else having these problems
-
Set time out for single webservice in NWDS 2004s
hai, i created webservices for session bean.created webservices are consumed by webdynpro client. when the webdynpro client consuming it.if the response takes more than 60 sec the webservices are timed out so i want to set the time out for my webse