|
Hi all,
I need to auto send email when some posted a new ticket/event in my project.Please help me to achieve.
Thanks a lot.
|
|
|
|
|
kavitha_blueindia wrote: I need to auto send email when some posted a new ticket/event in my project.
If you need to send it on a event then just write code for send mail on that event. or you want something else .
cheers,
Abhijit
|
|
|
|
|
You can use the method below.
C#
public void SendMail(string smtpAddress, string from,string to, string cc, string bcc, string body, string subject, bool isHtml,string attachmentFileNames)
{
SmtpClient insSmtpClient = new SmtpClient(smtpAddress);
MailMessage insMailMessage = new MailMessage();
insMailMessage.From = new MailAddress(from);
foreach (string strBcc in bcc.Split(";".ToCharArray(), StringSplitOptions.RemoveEmptyEntries))
{
insMailMessage.Bcc.Add(strBcc);
}
foreach (string strTo in to.Split(";".ToCharArray(), StringSplitOptions.RemoveEmptyEntries))
{
insMailMessage.To.Add(strTo);
}
foreach (string strCc in cc.Split(";".ToCharArray(), StringSplitOptions.RemoveEmptyEntries))
{
insMailMessage.CC.Add(strCc);
}
insMailMessage.Body = body;
insMailMessage.Subject = subject;
insMailMessage.IsBodyHtml = isHtml;
foreach (string strAtt in attachmentFileNames.Split(";".ToCharArray(), StringSplitOptions.RemoveEmptyEntries))
{
insMailMessage.Attachments.Add(new Attachment(strAtt));
}
insSmtpClient.Send(insMailMessage);
}
Kopyala
--------------------------------------------------------------------------------
VB.Net
Public Sub SendMail(ByVal smtpAddress As String, ByVal from As String, ByVal [to] As String, ByVal cc As String, ByVal bcc As String, ByVal body As String, _
ByVal subject As String, ByVal isHtml As Boolean, ByVal attachmentFileNames As String)
Dim insSmtpClient As New SmtpClient(smtpAddress)
Dim insMailMessage As New MailMessage()
insMailMessage.From = New MailAddress(from)
For Each strBcc As String In bcc.Split(";".ToCharArray(), StringSplitOptions.RemoveEmptyEntries)
insMailMessage.Bcc.Add(strBcc)
Next
For Each strTo As String In [to].Split(";".ToCharArray(), StringSplitOptions.RemoveEmptyEntries)
insMailMessage.[To].Add(strTo)
Next
For Each strCc As String In cc.Split(";".ToCharArray(), StringSplitOptions.RemoveEmptyEntries)
insMailMessage.CC.Add(strCc)
Next
insMailMessage.Body = body
insMailMessage.Subject = subject
insMailMessage.IsBodyHtml = isHtml
For Each strAtt As String In attachmentFileNames.Split(";".ToCharArray(), StringSplitOptions.RemoveEmptyEntries)
insMailMessage.Attachments.Add(New Attachment(strAtt))
Next
insSmtpClient.Send(insMailMessage)
End Sub
|
|
|
|
|
This is not the requirement. Main requirements is to send mail automatically with in a event.
cheers,
Abhijit
|
|
|
|
|
Actually, it is relevant, why wouldn't you just place that method call inside of the event being triggered?
|
|
|
|
|
I wrote an article on how to use google, I used sending emails as my example because
1 - it's SO easy to do
2 - there's SO much info on google about it and
3 - there's still SO many people too stupid to work it out.
It's on this site, you should read it.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Hi All,
I am creating Admin page for my project(ASP.Net 3.5 with MS Access).I got Access provider for Membership and Roles.
Membership is working well but for Roles it returns error message when run ASP.Net Website administration Tool and clicking the link "Use the security Setup Wizard to configure security step by step."
Error:
An error was encountered. Please return to the previous page and try again.
The following message may help in diagnosing the problem: Object reference not set to an instance of an object. at System.Web.UI.WebControls.ListControl.PerformDataBinding(IEnumerable dataSource) at System.Web.UI.WebControls.ListControl.OnDataBinding(EventArgs e) at System.Web.UI.WebControls.ListControl.PerformSelect() at System.Web.UI.WebControls.BaseDataBoundControl.DataBind() at ASP.security_wizard_wizardpermission_ascx.OnInit(EventArgs e) at System.Web.UI.Control.InitRecursive(Control namingContainer) at System.Web.UI.Control.InitRecursive(Control namingContainer) at System.Web.UI.Control.InitRecursive(Control namingContainer) at System.Web.UI.Control.InitRecursive(Control namingContainer) at System.Web.UI.Control.InitRecursive(Control namingContainer) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
can anyone guide how to solve this error?
modified on Thursday, January 1, 2009 11:39 PM
|
|
|
|
|
my application working fine in local and some other computers
but in few computers it on same lan it is giving error
unhandled expception occur for error place custom errors in web.config and set its mode to off
can anyone guide how to solve this error?
umerumerumer
|
|
|
|
|
mr_muskurahat wrote: unhandled expception occur for error place custom errors in web.config and set its mode to off
This is very common error in web application. Did you searched google for that ?
cheers,
Abhijit
|
|
|
|
|
For getting the details of the error,set custom errors in web.config and set its mode to off.Then you'll get the details
Cheers!!
Brij
|
|
|
|
|
ok thanks lets see...
umerumerumer
|
|
|
|
|
Do let me know the problem
Cheers!!
Brij
|
|
|
|
|
Hi frnds...
I create a one website on asp.net, but i don't know how to put website on server. plz help me & give full introduction about that. like web.config seting or other..
And also give the name they can provide free hosting on server.
Thankx.
|
|
|
|
|
Where do you want to host ? is it on local server or any hosting sites ?
cheers,
Abhijit
|
|
|
|
|
Bony_patel wrote: but i don't know how to put website on server. plz help me & give full introduction about that
Bony_patel wrote: And also give the name they can provide free hosting on server.
You have to ask your ISP to know why google is not working for you.
|
|
|
|
|
in order to test your application in local webserver you have to have installed iis in you system.
just go to build ->publish website and publish it and give that folder reference to iis in virtual directory.
umerumerumer
|
|
|
|
|
Hi, This is vamsi
iam facing one problem when i execute a web application after giving the usernam password it is going to the next page .now if copy the url and do logout then if i paste that same url in same web page the perticular web page is appearing it is not coming from application.it is coming from cache.Once i delete temporarly folder in internetoption its not repeating.but i want answer through programitically how remove the pericular page in cache . plz help me .
Thanks a lot
vamsi
M.Vamshidhar M.C.A.
|
|
|
|
|
This is Browser setting depends on browser.deleting the browser histry fro any client machine is not recommended.Give this as requirement that when user clicks on URL it should not cache.Set it from browser that whenever user hits on url it should take latest./server.
Cheers!!
Brij
|
|
|
|
|
This question is asked almost daily. You can find different answers by searching on this forum.
|
|
|
|
|
Hi,
I am trying to create folders dynamically using asp.net 2005. The code that i use here is already being used in .Net 2003 and is working fine there. But when i do the same thing in .Net 2005 the following is the error that i m getting :
<b>Request for the permission of type 'System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.</b>
I have given write permissions to everyone for that folder still it does not work. And this is not working on my local machine itself.
If anyone can suggest some solution to this.
thanks,
sabiha.
|
|
|
|
|
It's very tough to answer as you haven't provided any code that you use.
|
|
|
|
|
Here is the code that i use to create folders :
MImageDirectoryName = "~/pictures/folder1"
MImageDirectoryPath = Server.MapPath(MImageDirectoryName)
If Dir(MImageDirectoryPath, FileAttribute.Directory) = "" Then
MkDir(MImageDirectoryPath)
End If
The folder1 used here has read/write permissions. I feel as if the problem lies in the line server.mappath, also tried writing ../pictures/folder1, pictures/folder1 but still no use gives the same error.
|
|
|
|
|
Have you tried to use Directory class? Directory.CreateDirectory should do the trick.
|
|
|
|
|
Thank you for your reply.
Yes i tried using the directory class as you suggested but still the same permission issue. Actually the problem does not lie in the method we create folders but the statement that i write for getting path which is as under :-
MImageDirectoryName = "../Pictures/folder1"
MImageDirectoryPath = Server.MapPath(MImageDirectoryName)
It gives error in the line server.mappath .....
Can you suggest anything else pls .....
thanks,
sabiha.
|
|
|
|
|
In VS 2005,Style sheet has one property named filter and opacity but in VS 2008 there is no such property.
can any one tell me how to use that property in VS 2008.
|
|
|
|