16,008,490 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View .NET questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by manjukgowda (Top 11 by date)
manjukgowda
11-Jun-13 8:23am
View
using System.Web.Mail;
public static bool SendEmail(string EmailId, string Password, string To, string Subject, string Body, string AttachmentPath)
{
EmailId = EmailId.EndsWith("yahoo.in") ? EmailId.Replace("yahoo.in", "yahoo.com") : EmailId;
string server = null;
string port = null;
if (EmailId.Contains("gmail"))
{
server = "smtp.gmail.com";
port = "465";
}
else if (EmailId.Contains("yahoo"))
{
server = "smtp.mail.yahoo.com";
port = "465";
}
else if (EmailId.Contains("hotmail"))
{
server = "smtp.live.com";
port = "25";
}
else
{
server = "smtp.aol.com";
port = "465";
}
try
{
MailMessage myMail = new MailMessage();
myMail.Fields.Add
("http://schemas.microsoft.com/cdo/configuration/smtpserver",
server);
myMail.Fields.Add
("http://schemas.microsoft.com/cdo/configuration/smtpserverport",
port);
myMail.Fields.Add
("http://schemas.microsoft.com/cdo/configuration/sendusing",
"2");
myMail.Fields.Add
("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1");
//Use 0 for anonymous
myMail.Fields.Add
("http://schemas.microsoft.com/cdo/configuration/sendusername",
EmailId);
myMail.Fields.Add
("http://schemas.microsoft.com/cdo/configuration/sendpassword",
Password);
myMail.Fields.Add
("http://schemas.microsoft.com/cdo/configuration/smtpusessl",
"true");
myMail.Priority = MailPriority.High;
myMail.From = EmailId;
myMail.To = To;
myMail.Subject = Subject;
myMail.BodyFormat = System.Web.Mail.MailFormat.Html;
myMail.Body = Body;
if (AttachmentPath.Trim() != "")
{
MailAttachment MyAttachment = new MailAttachment(AttachmentPath);
myMail.Attachments.Add(MyAttachment);
}
SmtpMail.SmtpServer = string.Format("{0}:{1}", server, port);
SmtpMail.Send(myMail);
return true;
}
catch
{
return false;
}
}
manjukgowda
23-Jul-12 6:08am
View
Can u please help me to do this, i'm very disappointed from morning
manjukgowda
23-Jul-12 6:07am
View
:)
manjukgowda
23-Jul-12 5:59am
View
Yes got correct result when i executed the query in query window
My stored procedure also gives correct result when i executed as follows
exec selectemployeebyids(101,102,103,104)
- Gives correct result i.e all employees 101,102,103,104
exec selectemployeebyids('101,102,103,104')
- gives result only for employee id 101
manjukgowda
23-Jul-12 5:39am
View
http://www.codeproject.com/Articles/6083/Passing-comma-delimited-parameter-to-stored-proced#_rating
Here i got a solution that works in sqlserver superbly but i'm unable to do it mysql
Use Northwind
Go
-- @IDs is the string of comma delimited integers
-- (you can increase the size if you think that your array will be very large)
-- After parsings the string, integers are returned in a table
CREATE Function fnSplitter (@IDs Varchar(100) )
Returns @Tbl_IDs Table (ID Int) As
Begin
-- Append comma
Set @IDs = @IDs + ','
-- Indexes to keep the position of searching
Declare @Pos1 Int
Declare @pos2 Int
-- Start from first character
Set @Pos1=1
Set @Pos2=1
While @Pos1
manjukgowda
23-Jul-12 5:33am
View
I called that procedure from asp.net application
MySqlCommand cmd = new MySqlCommand("selectemployeebyids", Common.ConnectionStringManager.GetConnectionString());
cmd.CommandType = CommandType.StoredProcedure;
cmd.Connection.Open();
cmd.Parameters.AddWithValue("empid", id);
MySqlDataAdapter adap = new MySqlDataAdapter(cmd);
DataTable dt = new DataTable();
adap.Fill(dt);
cmd.Connection.Close();
return dt;
manjukgowda
23-Jul-12 5:28am
View
I'm passing that empids as varchar so that it takes as
Where empid IN ('101,102,103,104')
it returns result only for empid = 101
manjukgowda
23-Jul-12 5:19am
View
Actually by the above procedure i want to retrive empname , salary , department from employee table whose employee id is 101,102,103 and 104
manjukgowda
23-Jul-12 5:18am
View
Deleted
Actually by the above procedure i want to retrive empname , salary , department from employee table whose employee id is 101,102,103 and 104
manjukgowda
9-Aug-11 6:43am
View
I want to make it as it should return an equation like y = (x-5)/3;
manjukgowda
9-Aug-11 6:41am
View
You are not getting my question
I want to make it as it should return like y = (x-5)/3;
Show More