Sending Mail from Different Hot Spots/Internet Connections
I'm trying to set up my Mac Mail to be able to send emails out from Mac Mail when I am using random Air Port connections, like at Starbucks Hot Spots and other Internet connections. I use POP3 to bring in my Yahoo Mail, but when I want to send mail back out at say a Starbucks, it doesn't work. I'm not sure how to set up my Mac Mail Preferences to enable that. Can anyone tell me how to do so? Someone set up my computer to do so in the past, but my hard drive died and I can't figure out how to do the Preferences to make it happen again.
Thanks so much for any feedback.
Andy
G4 powerbook - OS 10.3.9
Mail Help has some articles devoted to sending problems, e.g. "I can't send email" or "I can't send email because the connection to the server on port 25 timed out". You may want to take a look at them in case there is something there that applies to you. Something that usually works is changing the outgoing server port to 587 instead of 25.
You may also need to go to System Preferences > Network > Show: Network Port Configurations, and make sure that the configuration used to connect to Internet appears at the top of the list. If this is different depending on your physical location, you can set up different "locations" in System Preferences > Network, to make it easier switching between network settings.
Similar Messages
-
Sending mails from client where SAPSERVER not connected to internet.
Hi
gurus
How to send mails thru my sap client , which is connected to server located different place. with Server Name esmart03_ESM_00 and my client , ESM(800).
1.The server is not connected to Internet.
SCOT settings maintained is
Default Domain ESM800
SMTP NODE settings
SAP Connect General
Node = SMTP
Description= mailserver
Mail Host = local host
port = 25
code page = 1100
checked Internet and * in Addrr
Default Domain = esmart
RZ10 Settings.
icm/server_port_2 PROT=SMTP,PORT=25,host=smtp.googlemail.com,TIMEOUT=180
is/SMTP/virt_host_2 *:25;
i had checked smicm for smtp port active, it is active as well as scif..
I appreciate for your answers where pts will be awarded..
i had gone thru sapnotes as well as help.sap.com..
regards
sriram venkat.Hi,
Your config is IMHO wrong.
You need to set smtp.googlemail.com in the SCOT settings and to remove it from icm/server_port_2.
You also need connectivity between your SAP server and smtp.googlemail.com.
There are 99% chances out of 100, that you need to open firewalls rules and/or set proxy servers.
Check that with your network team.
Regards,
Olivier -
Problem sending mail from different location
I cant send mail when connecting via a different server than my own network provider i.e. when connected wirelessly away from home office. Comes up with message:-
Verify that you have addressed this message correctly. Check your SMTP server settings in Mail Preferences and verify any advanced settings with your system administrator.
The server response was: <[email protected]>: Recipient address rejected: Relay access denied
You can try to send using a different server. All messages will use this server until you quit or change your network settings.
If I change the outgoing smtp setting to the network provider that I am connected to then mail will send.
Can this problem be rectified?
Kind regardsMost, if not all ISPs used for connecting to the internet now block the use of SMTP servers that are outside of their network (or not provided by the ISP) on Port 25 or what is termed "relay access" per the error message.
Some ISPs allow the use of an authenticated SMTP server only that is outside of their network on Port 25 but some block its use regardless.
These restrictions are in place as part of an overall effort to prevent spam emanating from the ISP's domain.
If the ntlworld SMTP server is not authenticated (even if authenticated there is no guarantee it will work depending on the restrictions imposed by the ISP used for connecting to the internet other than your own), you can try changing the server port from 25 to 587 but doing so is no guarantee either.
Go to Mail > Preferences > Accounts and under the Account Information tab for the ntlworld account preferences at the SMTP server selection, select the Server Settings button below.
Enter 587 in place of 25 in the Server Port field and when finished, select OK to save the changed setting.
If ntlworld has an authenticated SMTP server and it doesn't work on Port 25 when connected to the internet via a different ISP or using Port 587 for the SMTP server doesn't work regardless if the SMTP server that is outside of the ISP's network is authenticated or not, your only other option is using the SMTP server provided by the ISP used for connecting to the internet.
There is no other way to rectify this problem regardless the email client used or platform - OS X or Windows. -
Receive & send mail from different accounts
How do I receive mail from my Gmail account and send from another account?
I have the incoming server as an IMAP and it works fine. The outgoing mail server is the problem. It's set up as a different username and everything, and it STILL sends it through my GMail account. I deleted the outgoing smtp gmail server with no success. What should I do?
Thanks!I think it depends on your operating system.
You can test it by using java.net.Socket to create a bunch of
connections to the same host and port, close them, and then
see what your operating system shows. If you get the same
behavior there, it's an OS problem, or perhaps just the way
the OS works. You might want to check with a networking expert. -
Sending Mail from iPhone over SSL-encrypted connection
Hi,
when I synced my mail accounts to the iphone I had to accept the invalid certificate (it is self signed) once and that made imap work.
When I tried to send a mail over an encrypted connection to the smtp server, using the same certificate, it never asked me anything but refuses to send out the mail. It just stays in the outbox.
On server side I see in the logs:
lost connection after STARTTLS from <My Iphones Ip>
Is it possible to send mail using self signed certs with the iPhone these days. Or do I have to wait (or get an signed cert). Is there something like keychain management on the phone?
Thank you in advance.
ChristianHi!
I am suffering from the same problem. Did you found a solution already? -
Sending mail from different office locations
I can receive mail fine, using mail.mac.com, But I cannot send. I have 3 different office locations and would like to be able to use the Mail application and not just the webmail based app.
If this is not possible, I would like to at least be able to use the mail app. from home, however I am on a network at home on my roommates wireless connection. Do I need to have his user/pass entered using the smtp settings for our ISP?
Thank you very much for your help.If you are using smtp.mac.com to send the mail, try changing its port from 25 to 587.
A lot of ISPs are now blocking port 25 for anyone not using the ISP's smtp server. -
I have a Gmail ID (e.g [email protected])
I have a Exchange ID (e.g [email protected])
I need to configure exchange account (2007) such that I can send a mail from my Exchange account but at the receiver end it looks like it was sent from ([email protected]).
Both the accounts are my accounts.
I need this because I do not have access to my Gmail account from place where I access the internet and I need to send the mails from my Gmail account only.So you want to spoof your e-mail address.
You can make your Exchange server send as any address you want. Just create a different mailbox with that address as the primary (reply) address. It has to be a different account.
However, be aware that many systems to which you send such mail to will bounce it as suspected spam because they'll detect that your server is sending mail from Gmail but your server is not Gmail.
Ed Crowley MVP "There are seldom good technological solutions to behavioral problems." -
Have problems sending mail from a secure wireless connection. but ok from starbucks
I have several clients here at my marina all using different email providers and they all seem to have problems sending out mail from my secure wireless. They can recieve mail no problem. Now here is where it get weird. I added my gmail account to one of the problem iphones and same thing was happening, when i go to send out an email from my account on their phone it gets stuck trying to send mail. I compaired server setting on my phone to his and everything was that same, even turned off his server from fairpoint(the email he uses) and kept my gmail one and still couldnt send mail from his phone but worked fine on mine. Apple set up this individuals iphone/ipad so it make me think they did something when he had the accounts added. Any thoughts?
look here for gmail accounts
http://support.apple.com/kb/TS3058 -
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) -
Send mail from SAP system to another SAP system
Hello Xperts
I need to send a mail from one SAP box (ECC) to another SAP box (SRM,CRM, EP etc). I know how to send mail from SAP to external address but unable to find the parameters in this case. Kindly help.
thkx
Prabhu
PS: Kindly DONOT post on "How to send mail from SAP" as my questions is all abt how to send mail from one sap system to another sap systemHi
To send mail Internally check this sample code it works fine this code was developed by me
*& Report ZMATURITYREPORT *
*& Title - Maturity report *
*& ABAP/4 Consultant *
*& Name- Pavan Praveen Valluri Created on 26/07/2007 *
*& Module - FI *
REPORT ZMATURITYREPORT.
tables: bseg.
* SELECTION SCREEN--------------------------------------------------- *
parameters: p_email type somlreci1-receiver default
'@gujaratpetro.com'.
* Data: p_email(25) type c value '[email protected]'.
* END OF SELECTION SCREEN ------------------------------------------- *
*----------DATA DECLARATION--------------------------------------------*
data: it_message type standard table of solisti1 initial size 0
with header line.
data: it_message1 type standard table of solisti1 initial size 0
with header line.
data: it_message2(10) type N.
data: it_message3 type standard table of solisti1 initial size 0
with header line.
data: it_message4 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: text(150).
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.
data: lv_date type sy-datum.
data: lv_date1 type sy-datum.
data: lv_formatdate(10) type c.
data: lv_formatdate1(10) type c.
data: var1(4) type c,
var2(2) type c,
var3(2) type c.
data: begin of int_bseg occurs 0,
BELNR LIKE BSEG-BELNR,
ZUONR LIKE BSEG-ZUONR,
GJAHR LIKE BSEG-GJAHR,
DMBTR LIKE BSEG-DMBTR,
HKONT LIKE BSEG-HKONT,
end of int_bseg.
data: begin of int_SKAT occurs 0,
TXT50 LIKE SKAT-TXT50,
SAKNR LIKE SKAT-SAKNR,
KTOPL LIKE SKAT-KTOPL,
end of int_SKAT.
data: begin of int_bkpf occurs 0,
BELNR LIKE BKPF-BELNR,
BUKRS LIKE BKPF-BUKRS,
GJAHR LIKE BKPF-GJAHR,
BUDAT LIKE BKPF-BUDAT,
end of int_BKPF.
data: 2days_out type sy-datum.
2days_out = sy-datum + 2.
data: var4(4) type c,
var5(2) type c,
var6(2) type c.
*-------- END OF DATA DECLARATION--------------------------------------*
*--- CONCATENATING AND ARRANGING DATE ---------------------------------*
lv_date = 2days_out.
var1 = lv_date+(4).
var2 = lv_date+4(2).
var3 = lv_date+6(2).
concatenate var3 var2 var1 into lv_formatdate separated by '.'.
*--- END OF CONCATENATING AND ARRANGING DATE -------------------------*
*-------------------------SELECTION FOR BSEG---------------------------*
select zuonr belnr bukrs GJAHR DMBTR HKONT from bseg into
corresponding fields of table int_bseg
where bukrs = 'company name' and
ZUONR = lv_formatdate.
*--------------END OF SSELECTION FOR BSEG--------------------------- *
*-------------------------SELECTION FOR BKPF---------------------------*
select BUDAT BUKRS BELNR GJAHR from BKPF into
corresponding fields of table int_BKPF
where bukrs = 'company name'.
append int_BKPF.
*------------------END OF SELECTION FOR BKPF---------------------------*
*-------------------------SELECTION FOR SKAT---------------------------*
select SAKNR TXT50 from SKAT into
corresponding fields of table int_SKAT
where KTOPL = 'company name'.
*and SAKNR = INT_BSEG-HKONT.
APPEND INT_SKAT.
*--------------END OF SSELECTION FOR SKAT--------------------------- *
*-----------------POPULATING EMAIL SUBJECT ----------------------------*
perform populate_email_message_body.
perform send_file_as_email_attachment
tables it_message
it_attach
using p_email
'Maturity after 2 days'
'XLS'
'filename'
changing gd_error
gd_reciever.
* Instructs mail send program for SAPCONNECT to send email(rsconn01)
perform initiate_mail_execute_program.
*endif.
end-of-selection.
*------------END OF POPULATING EMAIL SUBJECT --------------------------*
*& 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 = 'SAPRPT'.
w_doc_data-obj_descr = ld_mtitle .
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.
* 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
object_header = t_object_header
packing_list = t_packing_list
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. "send_file_as_email_attachment
*& Form INITIATE_MAIL_EXECUTE_PROGRAM
* Instructs mail send program for SAPCONNECT to send email.
form initiate_mail_execute_program.
wait up to 2 seconds.
if gd_error eq 0.
submit rsconn01 with mode = 'INT'
with output = 'X'
and return.
endif.
endform. " INITIATE_MAIL_EXECUTE_PROGRAM
*& Form POPULATE_EMAIL_MESSAGE_BODY
* Populate message body text
form populate_email_message_body.
refresh it_message.
refresh it_message1.
refresh it_message3.
refresh it_message4.
*--------------- LOOP FOR BSEG -----------------------------------------
loop at int_BSEG.
read table int_bKPF WITH KEY BELNR = INT_BSEG-BELNR
GJAHR = INT_BSEG-GJAHR.
read table int_SKAT WITH KEY SAKNR = INT_BSEG-HKONT.
*---CHANGING DATE FORMAT FOR BKPF---------------------------------------
lv_date1 = int_bkpf-budat.
var4 = lv_date1+(4).
var5 = lv_date1+4(2).
var6 = lv_date1+6(2).
concatenate var6 var5 var4 into lv_formatdate1 separated by '.'.
*---END OF CHANGING DATE FORMAT FOR BKPF-------------------------
it_message = int_bseg-belnr.
it_message1 = lv_formatdate1.
it_message2 = int_bseg-dmbtr.
it_message3 = int_bseg-hkont.
IT_MESSAGE4 = INT_SKAT-TXT50.
SHIFT IT_MESSAGE2 LEFT DELETING LEADING '0'.
*-------------POPULATING EMAIL BODY WITH DATA -------------------------
concatenate 'Maturity After 2Days' 'for' 'G/L account-' it_message3
'--' IT_MESSAGE4 ',' 'Amount-' it_message2
into it_message separated by space.
append it_message.
append it_message1.
append it_message3.
clear it_message.
clear it_message1.
clear it_message2.
clear it_message3.
endloop.
*------------END OF LOOP FOR BSEG --------------------------------------
endform. " POPULATE_EMAIL_MESSAGE_BODY
<b><i>
To send an mail with external attachment check this one
</b></i>
<i>first create a Include report with the following coding</i>
*& Include ZPA1_INCLFOR_MAIL *
* Data
DATA: docdata LIKE sodocchgi1,
objpack LIKE sopcklsti1 OCCURS 1 WITH HEADER LINE,
objhead LIKE solisti1 OCCURS 1 WITH HEADER LINE,
objtxt LIKE solisti1 OCCURS 10 WITH HEADER LINE,
objbin LIKE solisti1 OCCURS 10 WITH HEADER LINE,
objhex LIKE solix OCCURS 10 WITH HEADER LINE,
reclist LIKE somlreci1 OCCURS 1 WITH HEADER LINE.
DATA: tab_lines TYPE i,
doc_size TYPE i,
att_type LIKE soodk-objtp.
DATA: listobject LIKE abaplist OCCURS 1 WITH HEADER LINE.
* FORM
FORM ml_customize USING objname objdesc.
*----------- Clear Variables
CLEAR docdata.
REFRESH objpack.
CLEAR objpack.
REFRESH objhead.
REFRESH objtxt.
CLEAR objtxt.
REFRESH objbin.
CLEAR objbin.
REFRESH objhex.
CLEAR objhex.
REFRESH reclist.
CLEAR reclist.
REFRESH listobject.
CLEAR listobject.
CLEAR tab_lines.
CLEAR doc_size.
CLEAR att_type.
*--------- Set Variables
docdata-obj_name = objname.
docdata-obj_descr = objdesc.
ENDFORM. "ml_customize
* FORM
FORM ml_addrecp USING preceiver prec_type.
CLEAR reclist.
reclist-receiver = preceiver.
reclist-rec_type = prec_type.
APPEND reclist.
ENDFORM. "ml_customize
* FORM
FORM ml_addtxt USING ptxt.
CLEAR objtxt.
objtxt = ptxt.
APPEND objtxt.
ENDFORM. "ml_customize
* FORM
FORM ml_prepare USING bypassmemory whatatt_type whatname.
IF bypassmemory = ''.
*--------- Fetch List From Memory
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
listobject = listobject
EXCEPTIONS
OTHERS = 1.
IF sy-subrc <> 0.
MESSAGE ID '61' TYPE 'E' NUMBER '731'
WITH 'LIST_FROM_MEMORY'.
ENDIF.
CALL FUNCTION 'TABLE_COMPRESS'
* IMPORTING
* COMPRESSED_SIZE =
TABLES
in = listobject
out = objbin
EXCEPTIONS
OTHERS = 1
IF sy-subrc <> 0.
MESSAGE ID '61' TYPE 'E' NUMBER '731'
WITH 'TABLE_COMPRESS'.
ENDIF.
ENDIF.
* Header Data
* Already Done Thru FM
* Main Text
* Already Done Thru FM
* Packing Info For Text Data
DESCRIBE TABLE objtxt LINES tab_lines.
READ TABLE objtxt INDEX tab_lines.
docdata-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( objtxt ).
CLEAR objpack-transf_bin.
objpack-head_start = 1.
objpack-head_num = 0.
objpack-body_start = 1.
objpack-body_num = tab_lines.
objpack-doc_type = 'TXT'.
APPEND objpack.
* Packing Info Attachment
att_type = whatatt_type..
DESCRIBE TABLE objbin LINES tab_lines.
READ TABLE objbin INDEX tab_lines.
objpack-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( objbin ).
objpack-transf_bin = 'X'.
objpack-head_start = 1.
objpack-head_num = 0.
objpack-body_start = 1.
objpack-body_num = tab_lines.
objpack-doc_type = att_type.
objpack-obj_name = 'ATTACHMENT'.
objpack-obj_descr = whatname.
APPEND objpack.
* Receiver List
* Already done thru fm
ENDFORM. "ml_prepare
* FORM
FORM ml_dosend.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = docdata
put_in_outbox = 'X'
commit_work = 'X' "used from rel. 6.10
* IMPORTING
* SENT_TO_ALL =
* NEW_OBJECT_ID =
TABLES
packing_list = objpack
object_header = objhead
contents_bin = objbin
contents_txt = objtxt
* CONTENTS_HEX = objhex
* OBJECT_PARA =
* object_parb =
receivers = reclist
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 'SO' TYPE 'S' NUMBER '023'
WITH docdata-obj_name.
ENDIF.
ENDFORM. "ml_customize
* FORM
FORM ml_spooltopdf USING whatspoolid.
DATA : pdf LIKE tline OCCURS 0 WITH HEADER LINE.
*-------------- Call Function
CALL FUNCTION 'CONVERT_OTFSPOOLJOB_2_PDF'
EXPORTING
src_spoolid = whatspoolid
TABLES
pdf = pdf
EXCEPTIONS
err_no_otf_spooljob = 1
OTHERS = 12.
*------------- Convert
PERFORM doconv TABLES pdf objbin.
ENDFORM. "ml_spooltopdf
* FORM
FORM doconv TABLES
mypdf STRUCTURE tline
outbin STRUCTURE solisti1.
*-------- Data
DATA : pos TYPE i.
DATA : len TYPE i.
*------------ Loop And Put Data
LOOP AT mypdf.
pos = 255 - len.
IF pos > 134. "length of pdf_table
pos = 134.
ENDIF.
outbin+len = mypdf(pos).
len = len + pos.
IF len = 255. "length of out (contents_bin)
APPEND outbin.
CLEAR: outbin, len.
IF pos < 134.
outbin = mypdf+pos.
len = 134 - pos.
ENDIF.
ENDIF.
ENDLOOP.
IF len > 0.
APPEND outbin.
ENDIF.
ENDFORM. "doconv
<b>
Then include that report in the following report and copy the same code and paste it there
</b>
*& Report ZPA_TEMP147 *
REPORT ZPA_TEMP147 .
INCLUDE zpa1_inclfor_mail.
* DATA
DATA : itab LIKE tline OCCURS 0 WITH HEADER LINE.
DATA : file_name TYPE string.
data : path like PCFILE-PATH.
data : extension(5) type c.
data : name(100) type c.
* SELECTION SCREEN
PARAMETERS : receiver TYPE somlreci1-receiver lower case.
PARAMETERS : p_file LIKE rlgrap-filename
OBLIGATORY.
* AT SELECTION SCREEN
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
CLEAR p_file.
CALL FUNCTION 'F4_FILENAME'
IMPORTING
file_name = p_file.
* START-OF-SELECTION
START-OF-SELECTION.
PERFORM ml_customize USING 'Tst' 'Testing'.
PERFORM ml_addrecp USING receiver 'U'.
PERFORM upl.
PERFORM doconv TABLES itab objbin.
PERFORM ml_prepare USING 'X' extension name.
PERFORM ml_dosend.
SUBMIT rsconn01
WITH mode EQ 'INT'
AND RETURN.
* FORM
FORM upl.
file_name = p_file.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = file_name
filetype = 'BIN'
TABLES
data_tab = itab
EXCEPTIONS
file_open_error = 1
file_read_error = 2
no_batch = 3
gui_refuse_filetransfer = 4
invalid_type = 5
no_authority = 6
unknown_error = 7
bad_data_format = 8
header_not_allowed = 9
separator_not_allowed = 10
header_too_long = 11
unknown_dp_error = 12
access_denied = 13
dp_out_of_memory = 14
disk_full = 15
dp_timeout = 16
OTHERS = 17.
path = file_name.
CALL FUNCTION 'PC_SPLIT_COMPLETE_FILENAME'
EXPORTING
complete_filename = path
* CHECK_DOS_FORMAT =
IMPORTING
* DRIVE =
EXTENSION = extension
NAME = name
* NAME_WITH_EXT =
* PATH =
EXCEPTIONS
INVALID_DRIVE = 1
INVALID_EXTENSION = 2
INVALID_NAME = 3
INVALID_PATH = 4
OTHERS = 5
ENDFORM. "upl
<b>These are the FM for sending external email :-</b>
SO_DOCUMENT_SEND_API1
SAPoffice: Send new document with attachments via RFC
SO_NEW_DOCUMENT_ATT_SEND_API1
(In 4.6C only, You can go to SE37 and click the documentation on how to use it. A sample program is provided there.)
SAPoffice: Send new document with attachments via RFC
Note : If you are using FM SO_NEW_DOCUMENT_ATT_SEND_API1 then Export Parameter DOCUMENT_DATA-OBJ_DESCR contains the Subject.
SO_NEW_DOCUMENT_SEND_API1
SAPoffice: Send new document
<b>Check this sample report</b>
DATA : BEGIN OF ITAB OCCURS 0,
PERNR LIKE PA0001-PERNR,
ENAME LIKE PA0001-ENAME,
END OF ITAB.
DATA: message_content LIKE soli OCCURS 10 WITH HEADER LINE,
receiver_list LIKE soos1 OCCURS 5 WITH HEADER LINE,
packing_list LIKE soxpl OCCURS 2 WITH HEADER LINE,
listobject LIKE abaplist OCCURS 10,
compressed_attachment LIKE soli OCCURS 100 WITH HEADER LINE,
w_object_hd_change LIKE sood1,
compressed_size LIKE sy-index.
START-OF-SELECTION.
SELECT PERNR ENAME
INTO CORRESPONDING FIELDS OF TABLE ITAB
FROM PA0001
WHERE PERNR < 50.
LOOP AT ITAB.
WRITE :/02 SY-VLINE , ITAB-PERNR, 15 SY-VLINE , ITAB-ENAME, 50
SY-VLINE.
ENDLOOP.
* Receivers
receiver_list-recextnam = '[email protected]'. "-->
* EMAIL ADDRESS
RECEIVER_list-RECESC = 'E'. "<-
RECEIVER_list-SNDART = 'INT'."<-
RECEIVER_list-SNDPRI = '1'."<-
APPEND receiver_list.
* General data
w_object_hd_change-objla = sy-langu.
w_object_hd_change-objnam = 'Object name'.
w_object_hd_change-objsns = 'P'.
* Mail subject
w_object_hd_change-objdes = 'Message subject'.
* Mail body
APPEND 'Message content' TO message_content.
* Attachment
CALL FUNCTION 'SAVE_LIST'
EXPORTING
list_index = '0'
TABLES
listobject = listobject.
CALL FUNCTION 'TABLE_COMPRESS'
IMPORTING
compressed_size = compressed_size
TABLES
in = listobject
out = compressed_attachment.
DESCRIBE TABLE compressed_attachment.
CLEAR packing_list.
packing_list-transf_bin = 'X'.
packing_list-head_start = 0.
packing_list-head_num = 0.
packing_list-body_start = 1.
packing_list-body_num = sy-tfill.
packing_list-objtp = 'ALI'.
packing_list-objnam = 'Object name'.
packing_list-objdes = 'Attachment description'.
packing_list-objlen = compressed_size.
APPEND packing_list.
CALL FUNCTION 'SO_OBJECT_SEND'
EXPORTING
object_hd_change = w_object_hd_change
object_type = 'RAW'
owner = sy-uname
TABLES
objcont = message_content
receivers = receiver_list
packing_list = packing_list
att_cont = compressed_attachment.
<b>Settings for sending mail</b>
Configuring SAP 4.6x Internet mail Gateway
SAP can be configured to send and receive emails from different sources.This section explains how to integrate SAPOffice with an external emailsystem. Your Internet email must be configured and running prior to this.Email from SAP is forwarded to the users external email system..
You can configure inbound and outbound forwarding. Outbound flow forwardsa SAP message (eg: update termination) via UNIX sendmail to the intended recepient. Inbound accepts a message from sendmail and places it in the users SAPOffice inbox. Many companies prefer to configure outbound only.
Configuring outbound forwarding
SAP configuration
1. Create your RFC destination for outbound email using transaction SM59
RFC Destination : SAP_INTERNET_GATEWAY
Connection Type : T
Description : SAP internet mail gateway
Click on 'Explicit Host' if you wanton demand gateway dameon invocation.
Program : /sapmnt/SID/exe/mlunxsnd
Target Host : Enter hostname that runs your central instance.
Click 'Test Connection' and you should seea successfull message.
2. Shared Office Settings transaction SO16-> Send -> Settings or
directly via transaction SCOT- SAPconnect Administation
Nodes - Create
Node : IMAIL
Description : SAP internet mail gateway
RFC Destination : SAP_INTERNET_GATEWAY
Tick : Internet
Address Area : *
Tick : All formats
Dev. type : Choose an approciate Printer Device
Set further addresstype : N
Maximum waiting timefor repeat send attempt procedure : Blank or decide for yourself
Tick : Node is ready for use
Setting
- DefaultDomain : <your company domain>.com
- Conversionrule : require if your communication device only support one format.
e.g. if you email system only support the format RAW (ASCII text format)
Format To Format Ranking Function module
ALI RAW 1 SX_OBJECT_CONVERT_ALI_RAW (convert APAP List)
Referto note 171698 - SAPconnect: Formats, conversion, device type
UNIX configuration
1 .. cd /sapmnt/SID/exe
2 ..csh
..mlsomadm mailgw.ini
System Name [C11] :
Client [000] :
Username : MAILADM
Password : MAILADM
Language : E
Load Balancing :
Hostname : <hostname>
System number : <instance_number>
Gateway hostname: <central_instance_hostname>
Gateway Service : <instance number>
Use SAP Router :
Trace level :
Sendmail Command [/usr/lib/sendmail -i -f<SENDER_ADDRESS>]:
Codepage [ISO-8859-1] :
Trace Level (Outbound) [0] :
Update file sapmailsid.cfg? [Y]
Testing whether your configuration is successful
1. Logon to SAP
2. Execute transaction SO01
3. Write a message and send it to <your_internet_email_address>
4. If you don't see the mail in your internet mailbox, go back and review steps 1-12
Schedule the SAP Internet Mail Gateway Jobs to start every 5 minutes
1. Create
2. Position your cursor at INT
3. Click Schedule and supply the date and time
4. Click Schedule periodically and tick Minutes and type in 5
5. Click Create and you are done
6. Click Show Scheduling to check
Problems that you might encounter :-
If you have set up a node in SCOT and it tests out well but recieve the reply.
"Cannot process message in node, parameterscannot be converted".
Make sure the RFC connection is working, and that SapConnect has been installed on the Unix Server or the Microsoft Exchange Server. Originally, I had the same error, and found that nothing had been installed on Unixor Exchange, to support SapConnect.
In SCOT (View -> System Status), your mail remains at the Intransit column.
Check you sendmail.cf files (e.g.Sun Solaris /etc/mail/sendmail.cf). Try using the sendmail command to send a test file at the Unix level. You must be able to send mail at theUnix level before you can send mail at the SAP level.
http://help.sap.com/saphelp_nw04/helpdata/en/cf/700b405bacdd5fe10000000a155106/content.htm
http://www.tamboly.com/SAPEmailConfiguration.html
Check my previous links
Mail Send
sending mails from abap program
Mail Sending to external email id's
settings needed for sending emails
Regards
Pavan -
Sending mail from one sap box to other sap box
how to send mail from one sap box to other sap box?
Hi Pavan,
To send mail Internally check this sample code.
*& Report ZMATURITYREPORT *
*& Title - Maturity report *
*& Module - FI *
REPORT ZMATURITYREPORT.
tables: bseg.
SELECTION SCREEN--------------------------------------------------- *
parameters: p_email type somlreci1-receiver default
'<b><email_removed_by_moderator></b>.
Data: p_email(25) type c value <b><hardcoding_removed_by_moderator></b>.
END OF SELECTION SCREEN ------------------------------------------- *
--DATA DECLARATION--
data: it_message type standard table of solisti1 initial size 0
with header line.
data: it_message1 type standard table of solisti1 initial size 0
with header line.
data: it_message2(10) type N.
data: it_message3 type standard table of solisti1 initial size 0
with header line.
data: it_message4 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: text(150).
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.
data: lv_date type sy-datum.
data: lv_date1 type sy-datum.
data: lv_formatdate(10) type c.
data: lv_formatdate1(10) type c.
data: var1(4) type c,
var2(2) type c,
var3(2) type c.
data: begin of int_bseg occurs 0,
BELNR LIKE BSEG-BELNR,
ZUONR LIKE BSEG-ZUONR,
GJAHR LIKE BSEG-GJAHR,
DMBTR LIKE BSEG-DMBTR,
HKONT LIKE BSEG-HKONT,
end of int_bseg.
data: begin of int_SKAT occurs 0,
TXT50 LIKE SKAT-TXT50,
SAKNR LIKE SKAT-SAKNR,
KTOPL LIKE SKAT-KTOPL,
end of int_SKAT.
data: begin of int_bkpf occurs 0,
BELNR LIKE BKPF-BELNR,
BUKRS LIKE BKPF-BUKRS,
GJAHR LIKE BKPF-GJAHR,
BUDAT LIKE BKPF-BUDAT,
end of int_BKPF.
data: 2days_out type sy-datum.
2days_out = sy-datum + 2.
data: var4(4) type c,
var5(2) type c,
var6(2) type c.
-- END OF DATA DECLARATION--
--- CONCATENATING AND ARRANGING DATE -
lv_date = 2days_out.
var1 = lv_date+(4).
var2 = lv_date+4(2).
var3 = lv_date+6(2).
concatenate var3 var2 var1 into lv_formatdate separated by '.'.
--- END OF CONCATENATING AND ARRANGING DATE -
--SELECTION FOR BSEG--
select zuonr belnr bukrs GJAHR DMBTR HKONT from bseg into
corresponding fields of table int_bseg
where bukrs = 'company name' and
ZUONR = lv_formatdate.
*--END OF SSELECTION FOR BSEG--
--SELECTION FOR BKPF--
select BUDAT BUKRS BELNR GJAHR from BKPF into
corresponding fields of table int_BKPF
where bukrs = 'company name'.
append int_BKPF.
--END OF SELECTION FOR BKPF--
--SELECTION FOR SKAT--
select SAKNR TXT50 from SKAT into
corresponding fields of table int_SKAT
where KTOPL = 'company name'.
*and SAKNR = INT_BSEG-HKONT.
APPEND INT_SKAT.
*--END OF SSELECTION FOR SKAT--
----POPULATING EMAIL SUBJECT -
perform populate_email_message_body.
perform send_file_as_email_attachment
tables it_message
it_attach
using p_email
'Maturity after 2 days'
'XLS'
'filename'
changing gd_error
gd_reciever.
Instructs mail send program for SAPCONNECT to send email(rsconn01)
perform initiate_mail_execute_program.
*endif.
end-of-selection.
----END OF POPULATING EMAIL SUBJECT -
*& 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 = 'SAPRPT'.
w_doc_data-obj_descr = ld_mtitle .
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.
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
object_header = t_object_header
packing_list = t_packing_list
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. "send_file_as_email_attachment
*& Form INITIATE_MAIL_EXECUTE_PROGRAM
Instructs mail send program for SAPCONNECT to send email.
form initiate_mail_execute_program.
wait up to 2 seconds.
if gd_error eq 0.
submit rsconn01 with mode = 'INT'
with output = 'X'
and return.
endif.
endform. " INITIATE_MAIL_EXECUTE_PROGRAM
*& Form POPULATE_EMAIL_MESSAGE_BODY
Populate message body text
form populate_email_message_body.
refresh it_message.
refresh it_message1.
refresh it_message3.
refresh it_message4.
LOOP FOR BSEG -
loop at int_BSEG.
read table int_bKPF WITH KEY BELNR = INT_BSEG-BELNR
GJAHR = INT_BSEG-GJAHR.
read table int_SKAT WITH KEY SAKNR = INT_BSEG-HKONT.
*-CHANGING DATE FORMAT FOR BKPF--
lv_date1 = int_bkpf-budat.
var4 = lv_date1+(4).
var5 = lv_date1+4(2).
var6 = lv_date1+6(2).
concatenate var6 var5 var4 into lv_formatdate1 separated by '.'.
*-END OF CHANGING DATE FORMAT FOR BKPF--
it_message = int_bseg-belnr.
it_message1 = lv_formatdate1.
it_message2 = int_bseg-dmbtr.
it_message3 = int_bseg-hkont.
IT_MESSAGE4 = INT_SKAT-TXT50.
SHIFT IT_MESSAGE2 LEFT DELETING LEADING '0'.
POPULATING EMAIL BODY WITH DATA -
concatenate 'Maturity After 2Days' 'for' 'G/L account-' it_message3
'--' IT_MESSAGE4 ',' 'Amount-' it_message2
into it_message separated by space.
append it_message.
append it_message1.
append it_message3.
clear it_message.
clear it_message1.
clear it_message2.
clear it_message3.
endloop.
END OF LOOP FOR BSEG -
endform. " POPULATE_EMAIL_MESSAGE_BODY
To send an mail with external attachment check this one
first create a Include report with the following coding
*& Include ZPA1_INCLFOR_MAIL *
Data
DATA: docdata LIKE sodocchgi1,
objpack LIKE sopcklsti1 OCCURS 1 WITH HEADER LINE,
objhead LIKE solisti1 OCCURS 1 WITH HEADER LINE,
objtxt LIKE solisti1 OCCURS 10 WITH HEADER LINE,
objbin LIKE solisti1 OCCURS 10 WITH HEADER LINE,
objhex LIKE solix OCCURS 10 WITH HEADER LINE,
reclist LIKE somlreci1 OCCURS 1 WITH HEADER LINE.
DATA: tab_lines TYPE i,
doc_size TYPE i,
att_type LIKE soodk-objtp.
DATA: listobject LIKE abaplist OCCURS 1 WITH HEADER LINE.
FORM
FORM ml_customize USING objname objdesc.
Clear Variables
CLEAR docdata.
REFRESH objpack.
CLEAR objpack.
REFRESH objhead.
REFRESH objtxt.
CLEAR objtxt.
REFRESH objbin.
CLEAR objbin.
REFRESH objhex.
CLEAR objhex.
REFRESH reclist.
CLEAR reclist.
REFRESH listobject.
CLEAR listobject.
CLEAR tab_lines.
CLEAR doc_size.
CLEAR att_type.
Set Variables
docdata-obj_name = objname.
docdata-obj_descr = objdesc.
ENDFORM. "ml_customize
FORM
FORM ml_addrecp USING preceiver prec_type.
CLEAR reclist.
reclist-receiver = preceiver.
reclist-rec_type = prec_type.
APPEND reclist.
ENDFORM. "ml_customize
FORM
FORM ml_addtxt USING ptxt.
CLEAR objtxt.
objtxt = ptxt.
APPEND objtxt.
ENDFORM. "ml_customize
FORM
FORM ml_prepare USING bypassmemory whatatt_type whatname.
IF bypassmemory = ''.
Fetch List From Memory
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
listobject = listobject
EXCEPTIONS
OTHERS = 1.
IF sy-subrc <> 0.
MESSAGE ID '61' TYPE 'E' NUMBER '731'
WITH 'LIST_FROM_MEMORY'.
ENDIF.
CALL FUNCTION 'TABLE_COMPRESS'
IMPORTING
COMPRESSED_SIZE =
TABLES
in = listobject
out = objbin
EXCEPTIONS
OTHERS = 1
IF sy-subrc <> 0.
MESSAGE ID '61' TYPE 'E' NUMBER '731'
WITH 'TABLE_COMPRESS'.
ENDIF.
ENDIF.
Header Data
Already Done Thru FM
Main Text
Already Done Thru FM
Packing Info For Text Data
DESCRIBE TABLE objtxt LINES tab_lines.
READ TABLE objtxt INDEX tab_lines.
docdata-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( objtxt ).
CLEAR objpack-transf_bin.
objpack-head_start = 1.
objpack-head_num = 0.
objpack-body_start = 1.
objpack-body_num = tab_lines.
objpack-doc_type = 'TXT'.
APPEND objpack.
Packing Info Attachment
att_type = whatatt_type..
DESCRIBE TABLE objbin LINES tab_lines.
READ TABLE objbin INDEX tab_lines.
objpack-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( objbin ).
objpack-transf_bin = 'X'.
objpack-head_start = 1.
objpack-head_num = 0.
objpack-body_start = 1.
objpack-body_num = tab_lines.
objpack-doc_type = att_type.
objpack-obj_name = 'ATTACHMENT'.
objpack-obj_descr = whatname.
APPEND objpack.
Receiver List
Already done thru fm
ENDFORM. "ml_prepare
FORM
FORM ml_dosend.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = docdata
put_in_outbox = 'X'
commit_work = 'X' "used from rel. 6.10
IMPORTING
SENT_TO_ALL =
NEW_OBJECT_ID =
TABLES
packing_list = objpack
object_header = objhead
contents_bin = objbin
contents_txt = objtxt
CONTENTS_HEX = objhex
OBJECT_PARA =
object_parb =
receivers = reclist
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 'SO' TYPE 'S' NUMBER '023'
WITH docdata-obj_name.
ENDIF.
ENDFORM. "ml_customize
FORM
FORM ml_spooltopdf USING whatspoolid.
DATA : pdf LIKE tline OCCURS 0 WITH HEADER LINE.
Call Function
CALL FUNCTION 'CONVERT_OTFSPOOLJOB_2_PDF'
EXPORTING
src_spoolid = whatspoolid
TABLES
pdf = pdf
EXCEPTIONS
err_no_otf_spooljob = 1
OTHERS = 12.
Convert
PERFORM doconv TABLES pdf objbin.
ENDFORM. "ml_spooltopdf
FORM
FORM doconv TABLES
mypdf STRUCTURE tline
outbin STRUCTURE solisti1.
Data
DATA : pos TYPE i.
DATA : len TYPE i.
Loop And Put Data
LOOP AT mypdf.
pos = 255 - len.
IF pos > 134. "length of pdf_table
pos = 134.
ENDIF.
outbin+len = mypdf(pos).
len = len + pos.
IF len = 255. "length of out (contents_bin)
APPEND outbin.
CLEAR: outbin, len.
IF pos < 134.
outbin = mypdf+pos.
len = 134 - pos.
ENDIF.
ENDIF.
ENDLOOP.
IF len > 0.
APPEND outbin.
ENDIF.
ENDFORM. "doconv
Then include that report in the following report and copy the same code and paste it there
*& Report ZPA_TEMP147 *
REPORT ZPA_TEMP147 .
INCLUDE zpa1_inclfor_mail.
DATA
DATA : itab LIKE tline OCCURS 0 WITH HEADER LINE.
DATA : file_name TYPE string.
data : path like PCFILE-PATH.
data : extension(5) type c.
data : name(100) type c.
SELECTION SCREEN
PARAMETERS : receiver TYPE somlreci1-receiver lower case.
PARAMETERS : p_file LIKE rlgrap-filename
OBLIGATORY.
AT SELECTION SCREEN
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
CLEAR p_file.
CALL FUNCTION 'F4_FILENAME'
IMPORTING
file_name = p_file.
START-OF-SELECTION
START-OF-SELECTION.
PERFORM ml_customize USING 'Tst' 'Testing'.
PERFORM ml_addrecp USING receiver 'U'.
PERFORM upl.
PERFORM doconv TABLES itab objbin.
PERFORM ml_prepare USING 'X' extension name.
PERFORM ml_dosend.
SUBMIT rsconn01
WITH mode EQ 'INT'
AND RETURN.
FORM
FORM upl.
file_name = p_file.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = file_name
filetype = 'BIN'
TABLES
data_tab = itab
EXCEPTIONS
file_open_error = 1
file_read_error = 2
no_batch = 3
gui_refuse_filetransfer = 4
invalid_type = 5
no_authority = 6
unknown_error = 7
bad_data_format = 8
header_not_allowed = 9
separator_not_allowed = 10
header_too_long = 11
unknown_dp_error = 12
access_denied = 13
dp_out_of_memory = 14
disk_full = 15
dp_timeout = 16
OTHERS = 17.
path = file_name.
CALL FUNCTION 'PC_SPLIT_COMPLETE_FILENAME'
EXPORTING
complete_filename = path
CHECK_DOS_FORMAT =
IMPORTING
DRIVE =
EXTENSION = extension
NAME = name
NAME_WITH_EXT =
PATH =
EXCEPTIONS
INVALID_DRIVE = 1
INVALID_EXTENSION = 2
INVALID_NAME = 3
INVALID_PATH = 4
OTHERS = 5
ENDFORM. "upl
These are the FM for sending external email :-
SO_DOCUMENT_SEND_API1
SAPoffice: Send new document with attachments via RFC
SO_NEW_DOCUMENT_ATT_SEND_API1
(In 4.6C only, You can go to SE37 and click the documentation on how to use it. A sample program is provided there.)
SAPoffice: Send new document with attachments via RFC
Note : If you are using FM SO_NEW_DOCUMENT_ATT_SEND_API1 then Export Parameter DOCUMENT_DATA-OBJ_DESCR contains the Subject.
SO_NEW_DOCUMENT_SEND_API1
SAPoffice: Send new document
Check this sample report
DATA : BEGIN OF ITAB OCCURS 0,
PERNR LIKE PA0001-PERNR,
ENAME LIKE PA0001-ENAME,
END OF ITAB.
DATA: message_content LIKE soli OCCURS 10 WITH HEADER LINE,
receiver_list LIKE soos1 OCCURS 5 WITH HEADER LINE,
packing_list LIKE soxpl OCCURS 2 WITH HEADER LINE,
listobject LIKE abaplist OCCURS 10,
compressed_attachment LIKE soli OCCURS 100 WITH HEADER LINE,
w_object_hd_change LIKE sood1,
compressed_size LIKE sy-index.
START-OF-SELECTION.
SELECT PERNR ENAME
INTO CORRESPONDING FIELDS OF TABLE ITAB
FROM PA0001
WHERE PERNR < 50.
LOOP AT ITAB.
WRITE :/02 SY-VLINE , ITAB-PERNR, 15 SY-VLINE , ITAB-ENAME, 50
SY-VLINE.
ENDLOOP.
Receivers
receiver_list-recextnam = '[email protected]'. "-->
EMAIL ADDRESS
RECEIVER_list-RECESC = 'E'. "<-
RECEIVER_list-SNDART = 'INT'."<-
RECEIVER_list-SNDPRI = '1'."<-
APPEND receiver_list.
General data
w_object_hd_change-objla = sy-langu.
w_object_hd_change-objnam = 'Object name'.
w_object_hd_change-objsns = 'P'.
Mail subject
w_object_hd_change-objdes = 'Message subject'.
Mail body
APPEND 'Message content' TO message_content.
Attachment
CALL FUNCTION 'SAVE_LIST'
EXPORTING
list_index = '0'
TABLES
listobject = listobject.
CALL FUNCTION 'TABLE_COMPRESS'
IMPORTING
compressed_size = compressed_size
TABLES
in = listobject
out = compressed_attachment.
DESCRIBE TABLE compressed_attachment.
CLEAR packing_list.
packing_list-transf_bin = 'X'.
packing_list-head_start = 0.
packing_list-head_num = 0.
packing_list-body_start = 1.
packing_list-body_num = sy-tfill.
packing_list-objtp = 'ALI'.
packing_list-objnam = 'Object name'.
packing_list-objdes = 'Attachment description'.
packing_list-objlen = compressed_size.
APPEND packing_list.
CALL FUNCTION 'SO_OBJECT_SEND'
EXPORTING
object_hd_change = w_object_hd_change
object_type = 'RAW'
owner = sy-uname
TABLES
objcont = message_content
receivers = receiver_list
packing_list = packing_list
att_cont = compressed_attachment.
Settings for sending mail
Configuring SAP 4.6x Internet mail Gateway
SAP can be configured to send and receive emails from different sources.This section explains how to integrate SAPOffice with an external emailsystem. Your Internet email must be configured and running prior to this.Email from SAP is forwarded to the users external email system..
You can configure inbound and outbound forwarding. Outbound flow forwardsa SAP message (eg: update termination) via UNIX sendmail to the intended recepient. Inbound accepts a message from sendmail and places it in the users SAPOffice inbox. Many companies prefer to configure outbound only.
Configuring outbound forwarding
SAP configuration
1. Create your RFC destination for outbound email using transaction SM59
RFC Destination : SAP_INTERNET_GATEWAY
Connection Type : T
Description : SAP internet mail gateway
Click on 'Explicit Host' if you wanton demand gateway dameon invocation.
Program : /sapmnt/SID/exe/mlunxsnd
Target Host : Enter hostname that runs your central instance.
Click 'Test Connection' and you should seea successfull message.
2. Shared Office Settings transaction SO16-> Send -> Settings or
directly via transaction SCOT- SAPconnect Administation
Nodes - Create
Node : IMAIL
Description : SAP internet mail gateway
RFC Destination : SAP_INTERNET_GATEWAY
Tick : Internet
Address Area : *
Tick : All formats
Dev. type : Choose an approciate Printer Device
Set further addresstype : N
Maximum waiting timefor repeat send attempt procedure : Blank or decide for yourself
Tick : Node is ready for use
Setting
- DefaultDomain : <your company domain>.com
- Conversionrule : require if your communication device only support one format.
e.g. if you email system only support the format RAW (ASCII text format)
Format To Format Ranking Function module
ALI RAW 1 SX_OBJECT_CONVERT_ALI_RAW (convert APAP List)
Referto note 171698 - SAPconnect: Formats, conversion, device type
UNIX configuration
1 .. cd /sapmnt/SID/exe
2 ..csh
..mlsomadm mailgw.ini
System Name [C11] :
Client [000] :
Username : MAILADM
Password : MAILADM
Language : E
Load Balancing :
Hostname : <hostname>
System number : <instance_number>
Gateway hostname: <central_instance_hostname>
Gateway Service : <instance number>
Use SAP Router :
Trace level :
Sendmail Command [/usr/lib/sendmail -i -f<SENDER_ADDRESS>]:
Codepage [ISO-8859-1] :
Trace Level (Outbound) [0] :
Update file sapmailsid.cfg? [Y]
Testing whether your configuration is successful
1. Logon to SAP
2. Execute transaction SO01
3. Write a message and send it to <your_internet_email_address>
4. If you don't see the mail in your internet mailbox, go back and review steps 1-12
Schedule the SAP Internet Mail Gateway Jobs to start every 5 minutes
1. Create
2. Position your cursor at INT
3. Click Schedule and supply the date and time
4. Click Schedule periodically and tick Minutes and type in 5
5. Click Create and you are done
6. Click Show Scheduling to check
Problems that you might encounter :-
If you have set up a node in SCOT and it tests out well but recieve the reply.
"Cannot process message in node, parameterscannot be converted".
Make sure the RFC connection is working, and that SapConnect has been installed on the Unix Server or the Microsoft Exchange Server. Originally, I had the same error, and found that nothing had been installed on Unixor Exchange, to support SapConnect.
In SCOT (View -> System Status), your mail remains at the Intransit column.
Check you sendmail.cf files (e.g.Sun Solaris /etc/mail/sendmail.cf). Try using the sendmail command to send a test file at the Unix level. You must be able to send mail at theUnix level before you can send mail at the SAP level.
http://help.sap.com/saphelp_nw04/helpdata/en/cf/700b405bacdd5fe10000000a155106/content.htm
http://www.tamboly.com/SAPEmailConfiguration.html
Check my previous links
Mail Send
sending mails from abap program
Mail Sending to external email id's
settings needed for sending emails
<b><points_request_removed_by_moderator></b>
Cheers,
CHAITANYA. -
Sending mail from using utl_smtp error......
Hi
When i try to send mail like as follows
DECLARE
v_connection UTL_SMTP.CONNECTION;
BEGIN
v_connection := UTL_SMTP.OPEN_CONNECTION('xxx.xxx.xxx.xxx',25);
UTL_SMTP.HELO(v_connection,'xxx.xxx.xxx.xxx');
UTL_SMTP.MAIL(v_connection,'[email protected]');
UTL_SMTP.RCPT(v_connection,'[email protected]');
UTL_SMTP.DATA(v_connection,'Sent From PL/SQL');
UTL_SMTP.QUIT(v_connection);
END;
I get the following error..
ERROR at line 1:
ORA-29278: SMTP transient error: 421 Service not available
ORA-06512: at "SYS.UTL_SMTP", line 17
ORA-06512: at "SYS.UTL_SMTP", line 96
ORA-06512: at "SYS.UTL_SMTP", line 138
ORA-06512: at line 4
if i send mail from outlook it goes...the configuration is like this
in mail properties general tab
email address : [email protected]
and i have to tick mark the "include this account when receiving mail or synchro" option
in servers tab
POP3 : xxx.xxx.xxx.xxx
smtp : xxx.xxx.xxx.xxx
and i have to tick the "My server requires authentication" option
and have to give the setting for that also
ie. log on using account : [email protected]
password: xxxxxx
How to Correct it ?
Krisi am on the same platform and in same account..... and PL/SQL UTL_SMTP gets a connection plus SMTP error, while telnet cannot even get a connection. A very weird one. Not sure what the problem can be.
Worse case, forget telnet and do all your troubleshooting using UTL_SMTP.. with liberal usage of DBMS_OUTPUT. :-)
regd. the connection from my xp client it is
connecting to the telnet server on server, but when i
tri to connect to the ISP's smtp address it throws
the errorNot that strange. You're likely going through a proxy of sorts of to reach the ISP mail server. Besides, to send mail you should be able to use your company's SMTP server as it should route Internet e-mail out to the net automatically.
In fact, many SMTP servers will not allow you to relay via them. E.g. if you connect from domain 1 to SMTP server on domain 2, and you submit an e-mail to be delivered to domain 3, the domain 2 server will tell you to take a hike. It will only accept mail that is destined for its own domain or originating from its own domain.
Reason for this is spam. Open relays are one of the prime reasons for having billions of spam mails being transmitted.
The correct method will be for you on domain 1 to connect to domain 1's SMTP server and submit an e-mail to be delivered to domain 3. That will be accepted and delivered. Using domain 2 as an intermediate agent to act as a relay, is/should not be accepted by all SMTP servers. (your SMTP server should get blacklisted/blackholed if it has an open relay) -
Will not send mail from new account
(I don't see a category for "mail" program on the discussions.)
I have a new account, but cannot get it to send mail from it. I get the message to try a different server, but no server works.
ThanksHi Mimi,
I reported your topic to have it moved to the Mac OS X v10.3 & earlier > Mail & Address Book forum.
It should be moved shortly.
In the meantime, it would help if you could post back with which OS version you are using (ie. OSX 10.3.9 ?) and who your ISP is (Internet Service Provider).
littleshoulders -
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.
-
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...
Maybe you are looking for
-
How can I transfer songs from ipod to itunes
I just found my old ipod and I want to transfer those old songs into my itunes and put it into my other idevices? ,Thank You
-
I need a link to automatically populate an enquiry form.
Right, I want a customer to be able to choose an item from a bunch of them, then click on a link next to the item, which will automatically fill in a specific field in an enquiry form. As in, clicking Dress #4 would straight off take you to the conta
-
My new iphone5 keeps texting me with the texts i send to my wifes iPhone 4
i have just got an iphone 5 and my wife has my iphone 4 - we seem to be connected via texts i am sending to her and anyone else on iphones via imessage - our applie ids are different - how do i stop this?
-
PowerBook won't stay closed!
My girlfriend's 12" PowerBook G4 will not stay closed. There is nothing wrong with the latch - the latch activates just fine and keeps the lid closed to the unit. However, it doesn't close enough - the screen will remain on and the unit will not go t
-
Hi Friends, I have an issue i am stuck here, i have to create BDC Program for XK01 tcode, and my requirement is that, i have three users first user want only three colum and second user want four column and third user want five column in table contro