Email notification depending on date
Here's what I need to do: I need compare an "Expiration Date" for various rows, compare each one to the current date and if the difference is less than 2 weeks, I need to send an email for each row.
I'm looking for some general guidelines on how this is done. Also, I know I can set up a Startup job on windows but I'd rather have the application do everthing on it's own.
I'm not doing any homework. I am a beginner and have limited experience. I am using the MVC model 2 architecture and I'm not quite sure how to fit this business requirement in. I don�t understand why some people automatically take this �do your own hw attitude� with beginners. Anyway�
Here's the situation:
I�m creating a simple �Domain Registration� app that stores information about registered domains and displays it. The issue is that I need to create a script that sends out an email when the domain�s expiration date is two weeks away. Of course I could have the application check the expiration date for each domain and then send an email depending on whether or not the exp date is two weeks away, but the issue is that I need to have it do this without having to do it manually. In other words, once I run the app, it should do a check for the exp dates in the database and set timers for the emails to go. I was looking at the Timer class but still don' t know where/when to start the timer.
I�m just asking for generic instructions on how to go about doing this. I don�t need specific java answers because I know java. This is a logic and experience question more than anything else. I hope this helps but if anyone else wants to give it a shot and you need more info let me know and I�ll do my best to give you as much of it as possible.
Similar Messages
-
Email Notification - User LogIn date
Hi All,
Our client has a requirement to send the email notification to the user if he has not logged in CRMOD for more than 2 days.
Does anybody has worked on similar kind of request. Please guide
Regards,
SI'm not doing any homework. I am a beginner and have limited experience. I am using the MVC model 2 architecture and I'm not quite sure how to fit this business requirement in. I don�t understand why some people automatically take this �do your own hw attitude� with beginners. Anyway�
Here's the situation:
I�m creating a simple �Domain Registration� app that stores information about registered domains and displays it. The issue is that I need to create a script that sends out an email when the domain�s expiration date is two weeks away. Of course I could have the application check the expiration date for each domain and then send an email depending on whether or not the exp date is two weeks away, but the issue is that I need to have it do this without having to do it manually. In other words, once I run the app, it should do a check for the exp dates in the database and set timers for the emails to go. I was looking at the Timer class but still don' t know where/when to start the timer.
I�m just asking for generic instructions on how to go about doing this. I don�t need specific java answers because I know java. This is a logic and experience question more than anything else. I hope this helps but if anyone else wants to give it a shot and you need more info let me know and I�ll do my best to give you as much of it as possible. -
Automatic Email notification of ST03N data
Hi everyone,
Currently, I provide <b>dialog steps data from ST03N</b> to my client on a daily basis using a spreadsheet that I send via email. I want to somehow <u>automate the data extraction process and the email notification sent to my client</u>. How can I do this? What do I need to setup in the system to achieve this?
Below are information about the SAP system:
Component version: SCM 4.10
Operating system: SunOS
Database system: ORACLE
SAP_ABA 640 SAPKA64017
SAP_BASIS SAPKB64017
PI_BASIS 2005_1_640 SAPKIPYJ67
ST-PI 2005_1_640 SAPKITLQH5
SAP_BW 350 SAPKW35017
EA-IPPE 300 SAPKGPIC11
SCM 410 SAPKY41011
SCM_BASIS 410 SAPK-41011INSCMBASIS
BI_CONT 353 SAPKIBIFQ0
ST-A/PI 01I_SCM410
Any inputs will be highly appreciated. Thank you!
Best regards,
KrisHi,
you can setup automated alert monitoring via CCMS, however I doubt there is automatic reporting of excel sheets.
Please check the link below:
http://help.sap.com/saphelp_nw70/helpdata/en/ac/825f18c02e454dac8da51f4eb22265/frameset.htm
Regards,
Siddhesh -
Auto Email notification based on data from Table
I need to send a auto email notification based on the information updated on the table. Like when response table is updated as 90 for ( column users).A Email should automatically trigger to the different users listed in a table named (email).. I have stored the value of users in a table named response and the person to whom i need to be email has been stored in table name email.
I'm using Oracle 10g Express edition
Let me know how this can be done automically.Wrong forum...should be over in the Database Forum or PLSQL forum. You need to add a trigger to the table and the trigger needs to utilize the UTL_MAIL or UTL_SMTP packages. You can get more info on UTL_MAIL here or more info on UTL_SMTP here
and here is some example code for a trigger:
create or replace trigger my_trigger
after insert or update
on my_table
for each row
begin
utl_mail.send(sender => '[email protected]',
recipients => '[email protected],[email protected]',
cc => '[email protected]',
bcc => '[email protected]',
subject => 'utl_mail test',
message => 'if you get this message it worked!');
end my_trigger;UTL_MAIL and UTL_SMTP may need some configuring before you use them, see the links above for details. -
Email Notifications Including Submitted Data
A lot of our clients use form central and allow users to attach images when filling out a form. This is great, however, when the email notification goes out it doesn't have the images in the email, just the filename of the image that was attached. Does FormCentral have any plans to change this functionality to include the image in the email? It would be greatly appreciated and allow us to recommend our clients use FormCentral a lot more.
Thank you.Hi;
No, there are other higher priority features that customers ask about more often so this won't likely change soon.
Thanks,
Josh -
Script to send Email notification depending on return value
When I run this I get a report of users who's accounts is about to expire, a scheduled task that run, say every week. Only problem it that this will send an email report even if there is nothing to report. What I would like is: if any return value is given
it sends the mail. If no return value is given it dosen't send any mail. I'm trying to get an if solution where if ($bodyoutstring return value -eq true) {send mailmessage} else {do nothing} But not sure this is possible since $bodyoutsring is a
variable? Input in this matter is appriciated.
###Change these according to your own setup
$smtpServer="smtpServer.com" #mailserver
$from = "Scheduled task, <[email protected]>" #mail from
$Recipient = [email protected] #mail to
# Script start - Get Users From AD who have AccountExpirationdate: 32 days left
Import-Module ActiveDirectory
# Email Subject Set Here
$subject="AD Accounts is about to expire."
#Variabel collect info and out-string it into html
$bodyoutstring = get-aduser -filter * -Properties * |Where-Object{$_.AccountExpirationdate -ne $null}| Select-Object Name, Description, SamAccountName,@{Name='DaysTilExpiration';Expression={($_.AccountExpirationdate - (get-date)).Days}} | Where-Object
{$_.DaysTilExpiration -le 32} | ConvertTo-Html| Out-String
# Send Email Message
Send-Mailmessage -smtpServer $smtpServer -from $from -to $Recipient -subject $subject -body $bodyoutstring -bodyasHTML -priority Normal
# End Send MessageHi,
You can do something like this:
If ($bodyoutstring) {
Send-MailMessage ...
This way if no results are returned no email is sent.
EDIT: Wait, I'm wrong. Since you're piping through ConvertTo-Html, you'll always get a result... Hold please.
EDIT2: This version checks the users first, then does the test and converts only if it needs to:
$userList = Get-ADUser -Filter * -Properties Description,AccountExpirationDate |
Where-Object { $_.AccountExpirationdate -ne $null }|
Select-Object Name, Description, SamAccountName,@{Name='DaysTilExpiration';Expression={($_.AccountExpirationdate - (get-date)).Days}} |
Where-Object {$_.DaysTilExpiration -le 32}
If ($userList) {
$bodyOutString = $userList | ConvertTo-Html | Out-String
SendMailMessage ...
I've also changed your -Properties parameter to return only the properties you need. Using * will slow your query down.
Don't retire TechNet! -
(Don't give up yet - 13,085+ strong and growing) -
I am trying to setup an email template for Change Request Reviewer. The email should contain as much details as possible, include Change Request ID, Description, Reason, Impact. etc. I have tried to include Data Properties from "Contains Activity",
"Has Parent Work Item", "Depends on Work Item"... but they all show blank data in email notification. Which Data Properties should I use?
Regards
AndrewMaybe this blog post is helpful:
Using Data Properties From the Parent Work Items in Activity Email Templates
Andreas Baumgarten | H&D International Group
Thanks Andreas,
I have seen this post, but it didn't work for me. Eventually, I found solution. Below is working code.
For example:
"Contains Activity" doesn't have Change Request Data Properties "Reason". I inserted "Reason" from "Has Parent Work Item", copy inserted code "TypeConstraint=... .../Reason$", paste it after "$Context/Path[... ...System.WorkItemContainsActivity' "
to replace the original code inserted from "Contains Activity".
Also, don't forget to adde SeedRole='Target', but better to type
' by yourself.
Mark Marra 13 Nov 2013 9:24 PM
Be careful when copying + pasting SeedRole=’Target’ from this blog post. It should actually be SeedRole='Target' which has different punctuation around Target. I'd imagine that whatever blog engine Microsoft uses for this "helpfully" converted the
single quote to some weird right-slanted-single-quote which doesn't work in Service Manager when copied+pasted.
You guys might want to wrap it in a code block, or whatever you can use on the back-end to preserve formatting.
Description:
<br><br>
$Context/Path[Relationship='CustomSystem_WorkItem_Activity_Library!System.WorkItemContainsActivity' SeedRole='Target' TypeConstraint='WorkItem!System.WorkItem']/Property[Type='WorkItem!System.WorkItem']/Description$
<br><br>
Reason:
$Context/Path[Relationship='CustomSystem_WorkItem_Activity_Library!System.WorkItemContainsActivity' SeedRole='Target' TypeConstraint='CustomSystem_WorkItem_ChangeRequest_Library!System.WorkItem.ChangeRequest']/
Property[Type='CustomSystem_WorkItem_ChangeRequest_Library!System.WorkItem.ChangeRequest']/Reason$
<br><br>
Priority: $Context/Path[Relationship='CustomSystem_WorkItem_Activity_Library!System.WorkItemContainsActivity' SeedRole='Target' TypeConstraint='CustomSystem_WorkItem_ChangeRequest_Library!System.WorkItem.ChangeRequest']/
Property[Type='CustomSystem_WorkItem_ChangeRequest_Library!System.WorkItem.ChangeRequest']/Priority$
<br><br>
Impact: $Context/Path[Relationship='CustomSystem_WorkItem_Activity_Library!System.WorkItemContainsActivity' SeedRole='Target' TypeConstraint='CustomSystem_WorkItem_ChangeRequest_Library!System.WorkItem.ChangeRequest']/
Property[Type='CustomSystem_WorkItem_ChangeRequest_Library!System.WorkItem.ChangeRequest']/Impact$
<br><br>
Risk: $Context/Path[Relationship='CustomSystem_WorkItem_Activity_Library!System.WorkItemContainsActivity' SeedRole='Target' TypeConstraint='CustomSystem_WorkItem_ChangeRequest_Library!System.WorkItem.ChangeRequest']/
Property[Type='CustomSystem_WorkItem_ChangeRequest_Library!System.WorkItem.ChangeRequest']/Risk$ -
How to create a Email Notification in SRM5.0 ?
Dear SRM Experts,
This is my requirement:
Requirement: If Delivery date for a PO is approaching, system should send notification E-mails to approvers and PO initiators. Program execution and dates for notifications will be affiliate specific.
Each affiliate should be able to define text for E-mail notification and number of days before delivery date when reminder should be sent.
We need to send an email notification if Delivery date is approaching that is 3 days before delivery date,if no action is taken then
PO needs to be locked .
Kindly help me regading the requirement.
Thanks&Regards,
ChitraChitra,
you can have one record per affiliate in the custom table with Standard Text name and no of days and in your program based on the text name and no of days you should able to send notification also for locking the PO from approval the work item can be deleted(by program) so that the approver can no longer approve the PO.
Thanks,
Suresh -
Email Notification with date field
Hi,
i marked the a field as Display field this way it is displayed in the Email notification. (%Records%).
But i can see the letral date field displayed in email as 2010:03:09:00:00:00:000
Why is the ''00:00:00:000'' displayed when i have a date field??
Did anyone face this issue..
KR
JohnHI John,
Date field in MDM is 18 characters long and has date as well as time component to it.
You can use assignment to trim this and transfer its value to another field and make that field as DF,so that it is displayed in the mail as date.
Otherwise you can also create a calculated field for this purpose.
Please go through this very useful link to create expressions/validations with dates:
http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/b025fab3-b3e9-2910-d999-a27b7a075a16?quicklink=index&overridelayout=true
Thanks,
Ravi -
Send Date Does Not Appear for Email Notification
Hi All,
Email notifications to user's mailbox do not have a date of send thus user can't sort it by the date. Can anyone tell me how to make the date appear?
ThanksSimilar functionality is available in PO and Req Approval process. Can you take a look at the PO Approval Process workflow? I remember the email notification does show the link, which is a URL link and has parameters in it. This functonality provides where the approvers need to modify the document which is requested to be approved. So they can click on the link, modify and close and approve if necessary.
Are you expecting them to modify the same or you just want to show query only screen?
There is a webpage available to see order information called Order Information (user Order Information User resp). You can send parameters to that webpage and that should show login page opening up a seperate session with all the parameters in the URL. Once logged in that should show order information.
Thanks
Nagamohan -
When I send an email notification that the form has been sent I want the receiver to get a copy of the actual filled out form not a ling to the data, how can I make this happen?
Hi,
you can find documentation for Designer under this website
http://help.adobe.com/en_US/livecycle/10.0/documentation.html#task=4,5&module=2
In Designer you can use the JavaScript API of Acrobat.
So the Devnet for Acrobat is also a good source.
http://www.adobe.com/devnet/acrobat.html
http://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/js_api_reference.pdf -
Delayed email notification in OIM
We want OIM to send an email notification to the user that a new account was created for that user on the target system, but there are some instances when we will not know the email address until after the account on the target system is created. Once the email address is known to OIM then we want it provisioned to the target system and the email notification to be sent. What options are there for doing this in OIM? We plan on using a pre-populate adapter to supply the process form with the email address obtained from the OIM user data.
thanks,
jayYou mean that after an account gets created in target system then only you can generate the EmailId for that user because you might have dependency like in case of AD-Exchange or your Email ID has to be dependent on some other attribute of the target system. If that is the case then:
- Create an initial account at the target.
- On completion of the Create Type process tasks, call another task which generates or know about this Email Id and put in the OIM User Profile. Not to mention that lookup USR_PROCESS_TRIGGER should have an entry.
- Attach a Change Email type task in the process definition of your target system. This transfers the Email to Process Form 'Email' attribute.
- Email Updated type task calls and transfers this Email value to the target.
- On the response C of this task, send an Email to to end-user about the successful account creation.
Thanks
Sunny -
Does threading work for email notifications in your email client?
Hi everyone,
We're trying to get a pulse from the community on what email clients and platforms you guys are using, especially in the case where the threading of email subscriptions isn't working. I have heard that threads can be grouped in Entourage on a Mac.
Can anyone Mac/Entourange users confirm this?
Would appreciate everyone's input on what mail client/OS you are using and if threading works for you or not. I know for the majority of you it isn't working, and we're looking at ways this can be addressed.
Thanks!
Here's the first entry: I use Microsoft Outlook on Windows XP and my email notifications don't thread.I think there is some confusion here on what is to be considered
threading and what isn't. Since I may have been causing some of that
confusion by not being as exact as I could have been in my many rants
about the subject, allow me to attempt to clarify a bit.
First, lets start with a sequence of messages to define a topic (I am
trying to avoid the word thread here). Somebody starts a topic with
message A. The first reply to message A is message B. The second reply
to message A is message see. In flat view the topic will look like this:
A
B
C
In threaded view it will look like this:
A
-- B
-- C
Now somebody is going to reply to message B in the topic. In flat view
this will look like:
A
B
C
D
In threaded view this will look like:
A
-- B
---- D
-- C
Strictly speaking only such a tree-like view is considered threading.
For instance what Gmail does is not strictly threading (more about that
later). Threading works because every email message has a Message-ID
that is a unique identifier of that message. When an email client
replies to a message it will create a new unique Message-ID for that
message, but it will take the Message-ID from the original and put it in
the References header so email replies have a pointer back to the
original message. If a threading email client receives a message with a
References header and it also has the email message to which that
References header points, the email client will show that message as a
child of the original. (This is still somewhat of a simplification and
skips over multiple IDs and the In-Reply-To header, for the exact
working see RFC 2822 section 3.6.4.)
This is what the whole Mozilla family of email clients does and most of
the old school Unix email clients as well.
What Gmail does (and what you can configure many email clients to do) is
to group messages by subject. Such a group of messages is in Gmail terms
a conversation. Then within that conversation messages are sorted by
date. This is different then threading. If a Gmail user had read
messages A, B and C of our example above and then navigated away, upon
returning to the conversation he will not find message D on the third
position in the conversation, but on the fourth. I think we should (and
I will try to remember to) refer to this behaviour as grouped display,
and not as threaded display.
Now, how can we use this to fix these forums?
The first part is simple: just add a References header to all outgoing
email. Only email clients that are configured to thread will do
something with that, so it will fix threading for those who want to use
threading without breaking anything for the email clients that don't
want to thread.
The impact of this on the Jive advancedemail plugin should be minimal.
Every outgoing email should just set its MessageID to the ID property of
the outgoing ForumMessage then test for the value of the parentMessgeID
property and if it is present set the References header. Append
@mail.forums.adobe.com to all IDs and you are done.
This will not fix the issue for the email clients that use grouping. To
(mostly) fix it for them, the simple solution is to just move the unique
code in the subject line forward until it appears before the "Re: " in
the subject. Email clients that use grouping are aware there might be an
code in the subject to indicate a message is a response (in English
usually "Re: ", other languages use something like "antwoord: " or
"resp: " etc.). They will group based on what is in the subject after
the "Re: " so that will put all the replies together.
It may not entirely fix it though, since the first message in a topic
doesn't have "Re :" it might be you end up with 2 groups, one with just
the first message and one with all the answers.
I already tested this and the Jive email import functionality does
support the code being in a different position, so it is just the
sending part that would need to be modified.
This does have a huge downside for the email clients that use neither
threading nor grouping (such as webmail clients like Squirrelmail and
IMP). If you use such a client and do a simple sort on the subject now
it will sort more or less correctly. If the code moves forward the
sorting there will disappear.
The last and final step / option is to change the Jive email import
functionality not to depend on that code but instead to depend on the
References header that an email client will put in the reply. That is a
significant change on the Jive side (and if Jive is going to do that I
have more suggestions to improve their core email system). Then
everybody can thread, group and sort however he likes, but Jive would
need to define a backup strategy for messages where an email client
fails to include a References header.
Jochem
Jochem van Dieten
http://jochem.vandieten.net/ -
SharePoint Foundation 2013 installed on Windows Server 2012 not sending out email notification
I have a server where i installed SP Foundation 2013 on top of Windows Server 2012. I have configured the SMTP as well as the outgoing SMTP in Central Administration
of SharePoint. When i create an alert on a document library, its did not sent any email notification on the changes made to the document in the document library. So, i created a workflow to send out email using SPD2013. The workflow run, but it cannot sent
out email with error saying that outgoing email is not configured correctly. I have checked with another server which i installed SP foundation 2013 on top of Windows Server 2008 R2 - its sending out email just fine using same configuration and outgoing SMTP.
I need help to resolve this issue or at least the cause of the problem.
Any help is greatly appreciated.
Try below:
http://social.technet.microsoft.com/wiki/contents/articles/13771.troubleshooting-steps-for-sharepoint-alert-email-does-not-go-out.aspx
Go to Central Admin ---->Operations----->outgoing email settings and verify that SMTP server is mentioned correctly
2) Test the connectivity with the SMTP server.
In order to do that follow these steps:
Open cmd
telnet <SMTP server name> 25 ( We connect smtp server to the port 25)
you should see a response like this 220 <servername> Microsoft ESMTP MAIL Service, Version: 6.0.3790.3959 ready at date and time
Beware that different servers will come up with different settings but you will get something
If you dont get anything then there could be 2 possible reasons, either port 25 is blocked or
the smtp server is not responding.
For testing response from your server
For testing response say ehlo to it.
Type :
ehlo <servername>
output:
250 <servername> Hello [IP Address]
Now a test mail can be sent from that SharePoint server.
Now we need to enter the From address of the mail.
Type :
mail from: [email protected]
output:
250 2.1.0 [email protected]….Sender OK
It's time to enter the recepient email address.
Type : rcpt to: [email protected]
output:
250 2.1.5 [email protected]
Now we are left with the data of the email. i.e. subject and body.
Type : data
output:
354 Start mail input; end with <CRLF>.<CRLF>
Type:
subject: this is a test mail
Hi
This is test mail body
I am testing SMTP server.
Hit Enter, then . and then Enter.
output:
250 2.6.0 <<servername>C8wSA00000006@<servername>> Queued mail for delivery
Type: quit
output:
221 2.0.0 <servername> Service closing transmission channe
3) Check alerts are enabled for your web application
verify if the windows timer service is running or not.
Run this stsadm command to check that
Stsadm.exe -o getproperty -url http://SharePoint-web-App-URL -pn alerts-enabled
This should return <Property Exist="Yes" Value="yes" />
If you don’t get this, Enable alerts by:
stsadm.exe -o setproperty -pn alerts-enabled -pv "true" -url http://SharePoint-web-App-URL
If its already enabled, try turn off and turn on it back.
4) Check the Timer job and Properties
Go to
MOSS 2007: Central Administration > Operations > Timer Job Definitions (under Global Configuration)
In SharePoint 2010: Central Administration > Monitoring > Review Job Definitions
Check whether the "Immediate Alerts" job is enabled for your web application. check these properties:
job-immediate-alerts
job-daily-alerts
job-weekly-alerts
stsadm.exe -o getproperty -url "http://Your-SharePoint-web-App-URL" -pn job-immediate-alerts
The expected output is:
<Property Exist="Yes" Value="every 5 minutes between 0 and 59"/>.
If you don’t get this, run the following command to set its value.
stsadm.exe -o setproperty -pn job-immediate-alerts -pv “every 5 minutes between 0 and 59" -url http://Your-SharePoint-web-App-URL
5) Check whether the account is subscribed for alerts and it has a valid email account. This should be the first thing to check if the problem persists for some users not for all.
6) Then check if at all those users have at least read permission for the list. Because the first mail should go out for every user without security validation but the next ones won't be delivered unless the user has at least read
permission.
7) If it is happening for one user, can also try to delete and re add the user in the site.
8) Most importantly , you should try this one.
Run this SQL query to the content db < Select * from Timerlock>
This will give you the name of the server which is locking the content database and since when.
In order to get rid of that lock
Go to that server which is locking the content db and then restart the windows timer service.
within some time it should release the lock from content db, if not then at the most stop the timer job for some time
Once the lock will be released then try to send some alerts
You will surely get the email alert.
I found this is the most probable reason for alert not working most of the time. We should start troubleshooting with above steps before coming to this step for any alert email issue but from step 1 to step 7 are best for new environments or new servers.
If the issue is like this ,alert was working before and suddenly stopped working without any environmental change then above conditions in step 1-7 should be ideally fine.
Even after this if it is not working, then you can try these few more steps too
9) Try re-registering the alert template:
stsadm -o updatealerttemplates -url http://Your-SharePoint-Web-App-URL -f "c:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\XML\alerttemplates.xml" -LCID 1033
10) Try to clear the configuration cache
If this helped you resolve your issue, please mark it Answered -
Cannot Send Email Notification Using Stored Procedure.
Hi Friends,
I tried to execute this job scheduler...
begin
dbms_scheduler.create_job(
job_name => 'ILMS_JOB_SCHEDULE'
,job_type => 'PLSQL_BLOCK'
,job_action => 'begin ilms.check_reminder(); end; '
,start_date => SYSTIMESTAMP
,repeat_interval => 'FREQ=DAILY'
,enabled => TRUE
,end_date => NULL
,comments => 'Ilms job schedule for notification.');
end;
However, since the effect is too long I rescheduled the frequency to be every one minute in this set attribute...
BEGIN
DBMS_SCHEDULER.SET_ATTRIBUTE(
name => 'ILMS_JOB_SCHEDULE'
,attribute => 'repeat_interval'
,value => 'FREQ=MINUTELY;INTERVAL=1'
DBMS_SCHEDULER.DISABLE('ILMS_JOB_SCHEDULE');
DBMS_SCHEDULER.ENABLE('ILMS_JOB_SCHEDULE');
END;
Check Reminder is the stored procedure invoked by job scheduler to check values in database columns before sending email notification to the respective recipients' email address and also the format of the email notification to be sent to the recipients...
CREATE OR REPLACE PROCEDURE check_reminder AS
NO number;
CURSOR emp_cur is
select * from pergerakan_ks where TASK_FLAG=7 and TASK_STATUS='InProgress';
emp_rec emp_cur%rowtype;
email_to varchar2(200);
default_email varchar2(200);
mesg varchar2(4000);
no_kes varchar2(100);
subj varchar2(4000);
kpi number;
crlf VARCHAR2( 2 ):= CHR( 13 ) || CHR( 10 );
BEGIN
default_email:='@abc.com.my';
FOR emp_rec in emp_cur
LOOP
if emp_rec.PKS_TKH_TERIMA is null then
dbms_output.put_line('count day ' || round(sysdate - to_date(emp_rec.pks_tkh_hantar)) || crlf || crlf);
if round(sysdate - to_date(emp_rec.pks_tkh_hantar)) >3 then
email_to:=emp_rec.pks_penghantar_id||default_email;
select b.KS_BIL_NO into no_kes from kertas_siasatan b where b.KS_ID = emp_rec.pks_ks_id;
subj:='Reminder untuk Membuat Tindakan Bagi No Kes '||no_kes;
mesg:='Reminder untuk Membuat Tindakan Bagi No Kes '||no_kes;
dbms_output.put_line('Sending email to ' || email_to || ' subject: ' || subj);
dbms_output.put_line('update old pergerakan pks_id : '||emp_rec.pks_id);
update pergerakan_ks set task_status='Done' where pks_id=emp_rec.pks_id;
dbms_output.put_line('insert new pergerakan ks : ');
insert into pergerakan_ks(pks_id,pks_ks_id,pks_km_id,pks_penghantar_id,pks_tkh_hantar,
pks_penerima_id,pks_tkh_terima,task_name,task_owner,task_status,task_flag,fb_id)
values(pks_id_seq.nextval,emp_rec.pks_ks_id,emp_rec.pks_km_id,
emp_rec.pks_penghantar_id,sysdate,
null,
null,emp_rec.task_name,
emp_rec.pks_penghantar_id,
'InProgress',6,emp_rec.fb_id);
commit;
e_mail_message(email_to,email_to,subj,mesg);
end if;
end if;
if emp_rec.PKS_TKH_TERIMA is not null then
dbms_output.put_line('emp_rec.pks_km_id ' || emp_rec.pks_km_id || crlf);
select c.KM_KPI into kpi from keluar_masuk_ks c where c.KM_ID = emp_rec.pks_km_id;
no := round(sysdate - to_date(emp_rec.pks_tkh_terima))-kpi;
dbms_output.put_line('count day - kpi' || no || crlf);
dbms_output.put_line('kpi ' || kpi || crlf);
if no = 1 then
email_to:=emp_rec.pks_penghantar_id||default_email;
select b.KS_BIL_NO into no_kes from kertas_siasatan b where b.KS_ID = emp_rec.pks_ks_id;
subj:='Reminder untuk Membuat Tindakan Bagi No Kes '||no_kes;
mesg:='Reminder untuk Membuat Tindakan Bagi No Kes '||no_kes;
dbms_output.put_line('Sending email to ' || email_to || ' subject: ' || subj);
email_to:=emp_rec.task_owner||default_email;
subj:='Reminder untuk Membuat Tindakan Bagi No Kes '||no_kes;
mesg:='Reminder untuk Membuat Tindakan Bagi No Kes '||no_kes;
dbms_output.put_line('Sending email to ' || email_to || ' subject: ' || subj);
e_mail_message(email_to,email_to,subj,mesg);
e_mail_message(email_to,email_to,subj,mesg);
end if;
if no = 3 then
select b.KS_BIL_NO into no_kes from kertas_siasatan b where b.KS_ID = emp_rec.pks_ks_id;
email_to:=emp_rec.task_owner||default_email;
subj:='Reminder untuk Membuat Tindakan Bagi No Kes '||no_kes;
mesg:='Reminder untuk Membuat Tindakan Bagi No Kes '||no_kes;
dbms_output.put_line('Sending email to ' || email_to || ' subject: ' || subj);
e_mail_message(email_to,email_to,subj,mesg);
end if;
end if;
END LOOP;
END;
E_mail_message is the stored procedure invoked by the check_reminder to tell scheduler information of the connection and the email address of the recipients...
CREATE OR REPLACE procedure
e_mail_message
from_name in varchar2,
to_name in varchar2,
subject in varchar2,
message in varchar2
is
l_mailhost VARCHAR2(64);
l_from VARCHAR2(64);
l_to VARCHAR2(64);
crlf VARCHAR2( 2 ):= CHR( 13 ) || CHR( 10 );
l_mail_conn UTL_SMTP.connection;
mesg VARCHAR2( 4000 );
BEGIN
select a.SERVER into l_mailhost from email_setting a where a.SERVER is not null;
select a.USERNAME into l_from from email_setting a where a.SERVER is not null;
--UTL_SMTP.open_data(l_mail_conn);
mesg:= 'Date: ' || TO_CHAR( SYSDATE, 'dd Mon yy hh24:mi:ss' ) || crlf ||
'From: <'||l_from||'>' || crlf ||
'Subject: ' ||subject|| crlf ||
'To: '||to_name || crlf || '' || crlf ;
mesg:=mesg||message;
l_mail_conn := UTL_SMTP.open_connection(l_mailhost, 25);
UTL_SMTP.helo(l_mail_conn, l_mailhost);
UTL_SMTP.mail(l_mail_conn, l_from);
UTL_SMTP.rcpt(l_mail_conn, to_name);
UTL_SMTP.data(l_mail_conn, mesg);
UTL_SMTP.quit(l_mail_conn);
END;
I tried to execute to execute the e_mail_message procedure but received this error. Also, no notification sent to the email address...
ORA-29279: SMTP permanent error: 501 5.1.3 Invalid address
ORA-06512: at "SYS.UTL_SMTP", line 21
ORA-06512: at "SYS.UTL_SMTP", line 99
ORA-06512: at "SYS.UTL_SMTP", line 241
ORA-06512: at "ILMS.E_MAIL_MESSAGE", line 33
ORA-06512: at line 13
Please help so that I can receive the email notification into my email...thanks in advance for your time..user13281540 wrote:
ORA-29279: SMTP permanent error: 501 5.1.3 Invalid address
ORA-06512: at "SYS.UTL_SMTP", line 21
ORA-06512: at "SYS.UTL_SMTP", line 99
ORA-06512: at "SYS.UTL_SMTP", line 241
ORA-06512: at "ILMS.E_MAIL_MESSAGE", line 33
ORA-06512: at line 13This is not an Oracle error - this is the mail server saying "+hey, I don't like that e-mail address you are supplying, I'm not accepting it!+".
If you look at RFC821 (Request For Comments memo 821 describes the SMTP specifications), you'll see that the sender and recipient needs to be supplied in the format +<[email protected]>+, e.g. +<[email protected]>+.
I have found that not all SMTP servers are equal in this regard. Some may insist on the brackets around the address, some may not.
You need to confirm the format of the addresses you use in the "+MAIL FROM+" and "+RCPT TO+" commands.. and ensure that these formats are accepted by your SMTP server - and if not, change your code to use an acceptable format.
The easiest way to do this is using telnet - and interacting directly and manually with the server. SMTP is a clear text protocol and easy to use manually. Try it. It is the best way to test SMTP interaction and validate the approach and SMTP commands and arguments used by your code.
Maybe you are looking for
-
My Ipod Clasic is no longer working and I do not know why.
I have a 120gb Ipod classic that a friend gave me after purchasing an Ipod touch. I have had it in my possession for almost a year now and have not had a problem up until recently. I would be listening to a podcast or a song and it would randomly jum
-
Problem with Oracle 8.1.7 and JDBC
Im connecting to Oracle 8.1.7 (running on a MS Windows Server) from a JBoss 2.4.10, running on a Linux box. The code that generates the problem looks like this : String query = "SELECT some_fields FROM some_table WHERE id = ?"; Prepared Statement ps
-
Onrelease gotoandplay PLEASE HELP!
I am new to CS4 and actionscript 3.0. I am developing a flash website for a friend of mine as a favor. Ive been stuck with a small problem for a day and a half already. I am used to the oldschool flash MX 5.0 and actionscript 1.0 where you could simp
-
I'm currently learning chinese and I noticed the characters look really not ok. From arch wiki, ttf-tw - Kai and Song traditional Chinese font from the Ministry of Education of Taiwan (AUR). wqy-microhei - A Sans-Serif style high quality CJK outline
-
PL/SQL Functions becoming 'invalid'
We have created a set of functions which are used by applications and triggers within our system. Everything ran over the weekend and all triggers were operating and functions were performing as expected. Yesterday the it was noticed that one of the