Sunday, May 17, 2020

Sending Emails With Attachments Using Delphi Indy

Below are instructions for creating an email sender that includes an option for sending email messages and attachments directly from a Delphi application. Before we begin, consider the alternative... Suppose you have an application that operates on some database data, among other tasks. Users need to export data from your application and send the data through an email (like an error report). Without the approach outlined below, you have to export the data to an external file and then use an email client to send it. Sending Email From Delphi There are many ways you can send an email directly from Delphi, but the simplest way is to use the ShellExecute API. This will send the email using the default email client installed on the computer. While this approach is acceptable, youre unable to send attachments this way.   Another technique uses Microsoft Outlook and OLE to send  the email, this time with attachment support, but MS Outlook is then required to be used. Yet another option is to use Delphis built-in support for the Windows Simple Mail API. This works only if the user  has a MAPI-compliant email program installed. The technique were discussing here uses Indy  (Internet Direct) components - a great internet component suite comprised of popular internet protocols written in Delphi and based on blocking sockets. The TIdSMTP (Indy) Method Sending (or retrieving) email messages with Indy components (which ships with Delphi 6) is as easy as dropping a component or two on a form, setting some properties, and clicking a button. To send an email with attachments  from Delphi using Indy, well need two components. First, the TIdSMTOP is used to connect and communicate (send mail) with an SMTP server. Second, the TIdMessage handles the storing and encoding of the messages. When the message is constructed (when TIdMessage  is filled with data), the email is delivered to an SMTP server using the TIdSMTP. Email Sender Source Code Ive created a simple mail sender project that I explain below. You can download the full source code here. Note:  That link is a direct download to the ZIP file for the project. You should be able to open it without any problems, but if you cant, use 7-Zip to open the archive so you can extract out the project files (which are stored in a folder called SendMail). As you can see from the design-time screenshot, to send an email using the TIdSMTP component, you at least need to specify the SMTP mail server (host). The message itself needs the regular email parts filled out, like the From, To, Subject, etc. Heres the code that handles sending one email with an attachment: procedure TMailerForm.btnSendMailClick(Sender: TObject) ; begin   Ã‚  StatusMemo.Clear;   Ã‚  //setup SMTP   Ã‚  SMTP.Host : ledHost.Text;   Ã‚  SMTP.Port : 25;   Ã‚  //setup mail message   Ã‚  MailMessage.From.Address : ledFrom.Text;   Ã‚  MailMessage.Recipients.EMailAddresses : ledTo.Text , ledCC.Text;   Ã‚  MailMessage.Subject : ledSubject.Text;   Ã‚  MailMessage.Body.Text : Body.Text;   Ã‚  if FileExists(ledAttachment.Text) then TIdAttachment.Create(MailMessage.MessageParts, ledAttachment.Text) ;   Ã‚  //send mail   Ã‚  try   Ã‚  Ã‚  Ã‚  try   Ã‚  Ã‚  Ã‚  Ã‚  Ã‚  SMTP.Connect(1000) ;   Ã‚  Ã‚  Ã‚  Ã‚  Ã‚  SMTP.Send(MailMessage) ;   Ã‚  Ã‚  Ã‚  except on E:Exception do   Ã‚  Ã‚  Ã‚  Ã‚  Ã‚  StatusMemo.Lines.Insert(0, ERROR: E.Message) ;   Ã‚  Ã‚  Ã‚  end;   Ã‚  finally   Ã‚  Ã‚  Ã‚  if SMTP.Connected then SMTP.Disconnect;   Ã‚  end; end; (* btnSendMail Click *) Note:  Inside the source code, youll find two extra procedures that are used to make the values of the Host, From, and To edit boxes persistent, using an INI file for storage.

Wednesday, May 6, 2020

The Story Of An Hour By Kate Chopin And The Yellow Wallpaper

The Story of an Hour by Kate Chopin and The Yellow Wallpaper by Charlotte Perkins Gilman written in the 1890s both reflect gender roles of this time, specifically women’s roles. In these stories both of the women are oppressed by their marriages, and by the end of the stories both wish to be rid of their husbands. Also, in both of these stories these women experience mental illnesses, mainly depression. These illnesses were looked at as something minor during this time, was it because psychologists were uneducated, or because as women their mental stability did not really matter? These stories connect so well because of their work to bring to the surface the reality of gender roles in the 1800s. Even though these stories were fictional their ideas were very real. By comparing how men and women were treated during this time, and how they are treated more equally now, it shows that with time American has come a long way. When the woman in The Story of an Hour is told the news of her husband’s death, she is treated as a fragile as a flower, like there is no way she is strong enough to take this type of news. There are many ways to take her reaction of sobbing, but it seems that she does this because she is sad. But when it’s considered in a different life it seems she does this because her husband’s death opens up a world of opportunity to her. As a housewife in the 1800s she was expected to stay home, cook, clean, raise kids and basically pamper her husband. Even if she lovedShow MoreRelatedKate Chopin s The Yellow Wallpaper And The Story Of An Hour1887 Words   |  8 Pageswithout a word coming out of their mouths. Two out of the ordinary short stories, â€Å"The Yellow Wallpaper† and â€Å"The Story of An Hour,† mostly focused on a women’s dilemma that they faced near the 19th century. The two main characters in the short stories show some resemblances in some ways, but both characters portrayed them in different ways of how they dealt their sorrows in their marriages. â€Å"The Story of An Hour† by Kate Chopin is about a woman named Louise Mallard, who was very unsatisfied with herRead MoreAnalysis Of Kate Chopin s The Story Of An Hour And The Yellow Wallpaper 721 Words   |  3 Pagesrisk your sanity or even your life? â€Å"The Story of an Hour† by Kate Chopin and â€Å"The Yellow Wallpaper† by Charlotte Perkins Gilman both illustrate the feeling of wanting to escape and gaining freedom. Both stories are about a woman who is oppressed by her husband and trying to find a way to overcome this depression. These stories are written during the 19th century, a time in which women were seen as weak and did not have many rights. In â€Å"The Story of an Hour†, Mrs. Mallard is suffering from some kindRead MoreComparing The Story of an Hour, by Kate Chopin and The Yellow Wallpaper, by Charlotte Perkins Gilman850 Words   |  4 PagesThe Yellow Wallpaper, by Charlotte Perkins Gilman, and The Story of an Hour, by Kate Chopin are two very similar stories. Both women were controlled by their husbands who caused them to feel an intense desire for freedom. However, the women in the stories had different life experiences and different reactions to their own freedom as a result of their different personalities. Mrs. Mallard in The Story of an Hour had to deal with a sort of burden. Her husband had control over her body andRead More Freedom for Women in The Yellow Wallpaper by Charlotte Perkins Gillman and The Story of an Hour by Kate Chopin1202 Words   |  5 Pagesfor Women in The Yellow Wallpaper by Charlotte Perkins Gillman and The Story of an Hour by Kate Chopin The Yellow Wallpaper by Charlotte Perkins Gillman and The Story of an Hour by Kate Chopin are two feminist works in which liberation is the overlying theme. Both of the main characters achieve freedom from their husbands oppression in these short stories; however, freedom is only achieved through insanity in The Yellow Wallpaper and death in The Story of an Hour. The women in theseRead MoreThe Yellow Wallpaper And The Story Of An Hour Analysis983 Words   |  4 PagesCharlotte Gilman’s â€Å"The Yellow Wallpaper† and Kate Chopin’s â€Å"The Story of an Hour† both take place primarily in domestic spaces representative of the attitudes and feelings of each character. â€Å"The Yellow Wallpaper† tells the story of a young woman’s decent into depression and madness, commonly attributed to the excessive and unnecessary control her husband exerts over her. â€Å"The Story of an Hour† delves into the conflicted mind of a young woman after hearing the news of her husband’s death and herRead More Oppression of Women in Chopins Story of an Hour and Gilmans Yellow Wallpaper 1246 Words   |  5 PagesChopins Story of an Hour and Gilmans Yellow Wallpaper    The Story of an Hour by Kate Chopin and The Yellow Wallpaper by Charlotte Perkins Gilman share the same view of the subordinate position of women in the late 1800s. Both stories demonstrate the devastating effects on the mind and body that result from an intelligent person living with and accepting the imposed will of another. This essay will attempt to make their themes apparent by examining a brief summery of their stories and relatingRead MoreKate Chopin s The Yellow Wallpaper1415 Words   |  6 PagesVictorian era were Kate Chopin and Charlotte Perkins Gilman. The Victorian era brought out many different themes of freedom, confinement, and inequity. The Victorian themes can be seen in Kate Chopin’s writing called, â€Å"The Story of an Hour† and Charlotte Perkins Gilman’s writing called, â€Å"The Yellow Wallpaper.† There are many similarities and differences between both Victorian women’s perspectives and writing. This paper will compare a nd contrast the short stories written by Kate Chopin and CharlotteRead MoreComparing the Yellow Wallpaper Story of an Hour1255 Words   |  6 Pagesor even your life? Both â€Å"The Yellow Wallpaper† by Charlotte Perkins Gilman and â€Å"The Story of an Hour† by Kate Chopin are two short stories that can today be categorized as feminist works of fiction. The main characters are females who are struggling for freedom from their husbands. Although the characters situations differ and the women react differently once they are aware of their suppression, the authors use similar motifs, imagery and themes. Both Gilman and Chopin use irony and the themes ofRead More Comparing Charlotte Perkins Gilmans The Yellow Wallpaper; and Kate Chopins The Story of an Hour1097 Words   |  5 PagesComparing Charlotte Perkins Gilmans The Yellow Wallpaper and Kate Chopins The Story of an Hour The Yellow Wallpaper;, by Charlotte Perkins Gilman, and The Story of an Hour;, by Kate Chopin, are alike in that both of the women in the stories were controlled by their husbands which caused them to feel an intense desire for freedom. Both stories were also written from a feminist point of view. However, the women in the stories had different life changes and different responses to theirRead MoreThe Yellow Wallpaper And The Story Of An Hour Analysis780 Words   |  4 PagesThroughout history, women have struggled to be seen as equals and have had to fight for their freedom from the roles society placed upon them. Kate Chopin and Charlotte Perkins Gilman both use their literary works to show the challenges women went through, and how they battled for the freedoms they desperately wanted. â€Å"The Yellow Wallpaper† is a short story about a woman that goes to a summer home to rest and get well under the supervision of her husband who is also a physician. Her husband decided

Booker T. Washington (1336 words) Essay Example For Students

Booker T. Washington (1336 words) Essay Booker T. WashingtonMerrix WatsonProf. AlexanderFeb. 17, 2000Imagine being in a position that gave you the power to inspire a race and gain the respect of another. Booker T. Washington, a prominent and extremely successful African-American had that opportunity. This opportunity came in the times of the emancipation of slavery. And when given the chance he excelled. In his book, Up from Slavery, Booker T. Washington exposes readers to the hardships he faced from the time he was a slave, until the times he became a leader among African-Americans. His book gives detailed accounts of his life, from a first. It speaks of slavery, racism, triumph, and struggle, which all couldnt overpower handwork. Hard working was something Washington believed in and was. The most in unheard voice at the time of slavery both past and present, was that of the African-American women. During these periods, female accomplishments were not recognized. These accomplishments have been brought forth for people to view them in one of many books. The book, Voice from the South, by Anna Cooper combines works of fiction, poetry, autobiographies, and biographies. Cooper was one of few black woman of her time to earn a Ph.D. She was a feminist who believed that womens voices shouldnt go unheard. The book displays great moments of triumph that conquer over hard bearing obstacles. The book is quite interesting one that focuses on black womens writings in the nineteenth and twentieth century. The context however seems to jump around from subject to subject, which could often confuse the reader. This book seems to be drunk on syntax blind to semantics. In other words this book tended to use words that went around the subject. These books try to focus on all aspects of the struggles of both women of color and of African Americans as a whole. A big difference between these books is the fact that one of the voices was heard while the other silenced. Though in times of racism, black males still received more respect then women. My goal is to compare and contrast these two books. Washington spoke a lot about his life through out his book. But the main point he was trying to show was gaining education for the black race. As this was the purpose in the Voice from the South. It was a long, tough road, for both Black men and women alike. I have learned that success is not measured not so much by the position one has reached in life is, but by the obstacles he has overcome while trying to succeed. (Washington p.23)This is a quote Washington lived by. Born a slave in Franklin county, Virginia. After the emancipation, he and his family moved to West Virginia where his stepfather had found work in the coalmines. The m ines were to be thestarting point for Washington as he began his quest for education. He first started with a book that taught the basics. Soon after that Washington set out to attend the Hampton Institute in Virginia. There he would work as a janitor to pay his way through college. He studied under a man by the name of General Armstrong, whom he admired the most. After receiving his degree, he briefly went Armstrong, whom he admired the most. After receiving his degree, he briefly went home only to be called back to Hampton to teach. What he had learned from Hampton what could be accomplished when you never give up. During this time at Hampton, Washington was in charge of educating Indians with the help of his students, both male and female. But what he really wanted to do was educatehis own race. And with this idea he received word from some men in Alabama, that there a request put in for a teacher to come teach a school in Tuskegee. Booker T. Washington saw this opportunity and a ccepted it. He then moved to Alabama to begin what would become a legacy. The school was built by the students that attended, which would pay for part of their tuition. Washington believed that it was better to earn a trade than it was to study things such as Greek and the arts. I have found too that, that it is the visible, the tangible goes a long ways in softening prejudices. The actual sight of a first-class house thata Negro built has built is ten times more potent that the pages of discussion about a house that he ought to build, or perhaps could build.(Washington p.72) This view would be later argued by another prominent black figure, W.E.B. .u6a5bd8389f93dbbcd8befcf96d41029d , .u6a5bd8389f93dbbcd8befcf96d41029d .postImageUrl , .u6a5bd8389f93dbbcd8befcf96d41029d .centered-text-area { min-height: 80px; position: relative; } .u6a5bd8389f93dbbcd8befcf96d41029d , .u6a5bd8389f93dbbcd8befcf96d41029d:hover , .u6a5bd8389f93dbbcd8befcf96d41029d:visited , .u6a5bd8389f93dbbcd8befcf96d41029d:active { border:0!important; } .u6a5bd8389f93dbbcd8befcf96d41029d .clearfix:after { content: ""; display: table; clear: both; } .u6a5bd8389f93dbbcd8befcf96d41029d { display: block; transition: background-color 250ms; webkit-transition: background-color 250ms; width: 100%; opacity: 1; transition: opacity 250ms; webkit-transition: opacity 250ms; background-color: #95A5A6; } .u6a5bd8389f93dbbcd8befcf96d41029d:active , .u6a5bd8389f93dbbcd8befcf96d41029d:hover { opacity: 1; transition: opacity 250ms; webkit-transition: opacity 250ms; background-color: #2C3E50; } .u6a5bd8389f93dbbcd8befcf96d41029d .centered-text-area { width: 100%; position: relative ; } .u6a5bd8389f93dbbcd8befcf96d41029d .ctaText { border-bottom: 0 solid #fff; color: #2980B9; font-size: 16px; font-weight: bold; margin: 0; padding: 0; text-decoration: underline; } .u6a5bd8389f93dbbcd8befcf96d41029d .postTitle { color: #FFFFFF; font-size: 16px; font-weight: 600; margin: 0; padding: 0; width: 100%; } .u6a5bd8389f93dbbcd8befcf96d41029d .ctaButton { background-color: #7F8C8D!important; color: #2980B9; border: none; border-radius: 3px; box-shadow: none; font-size: 14px; font-weight: bold; line-height: 26px; moz-border-radius: 3px; text-align: center; text-decoration: none; text-shadow: none; width: 80px; min-height: 80px; background: url(https://artscolumbia.org/wp-content/plugins/intelly-related-posts/assets/images/simple-arrow.png)no-repeat; position: absolute; right: 0; top: 0; } .u6a5bd8389f93dbbcd8befcf96d41029d:hover .ctaButton { background-color: #34495E!important; } .u6a5bd8389f93dbbcd8befcf96d41029d .centered-text { display: table; height: 80px; padding-left : 18px; top: 0; } .u6a5bd8389f93dbbcd8befcf96d41029d .u6a5bd8389f93dbbcd8befcf96d41029d-content { display: table-cell; margin: 0; padding: 0; padding-right: 108px; position: relative; vertical-align: middle; width: 100%; } .u6a5bd8389f93dbbcd8befcf96d41029d:after { content: ""; display: block; clear: both; } READ: Isaac Asimov, Mind of a Child EssayDu Bois. So Tuskegee became an institute of trade. Though in the midst of racism, Washington faced triumph gaining the support of the whites in the Du Bois. So Tuskegee became an institute of trade. Though in the midst of racism, Washington faced triumph gaining the support of the whites in the community. To earn money for the school, Washington set out across America in order to gain money for the school. His campaign promoted teaching the Negro atrade as opposed to book knowledge. Whites actively supported the teaching of a trade, feeling that the Negro would never be first class. In Atlanta he gavehis famous Atlanta Exposition Address. Both races applauded the words spoken by him. But in it he seems to put black on the bottom of the scale. It is at the bottom we must begin.(Washington pg.101) This is the very statement that many educated blacks such as Du Bois argued against. W.E.B. Du Bois believed in book knowledge. This was the knowledge that would help the black man excel. In Alice Coopers, Voice from the South, she believed in starting at the top. The object was to recognize the female for her role in the rise of the race. But her book shows females as the unheard part of the African American race. Cooper states, The colored women of to-day occupies, one may say, a unique position in this country. In A period of itself transitional and unsettled, her status seems one of the least ascertainable and definitive of all the forces which make our civilization. (Cooper pg.134). In the context with Voice from the South, Cooper strived to raise the voice of the black women. Men actually agreed with Cooper saying, the y want females to learn as much as they did. We are ready to make any modifications in those relations which will satisfy the womans just aspiration for personal independence, for intellectual and moral development, for the physical culture, for political activity, and for a voice in the arrangement of her own affairs, both domestic and national. (Cooper pg.67)With in marriage, they felt that women would make a better half if educated. All Cooper would hope to accomplish would come in time. Her efforts were recognized by many in the United States. She would be one of the first to put the African American female in the national spotlight. In my opinion the two books focus on strong points. These books attempted to show readers that black faced hardships to gain an education. Even tougher was gaining education for Black females. Both Authors were leaders in the African American Communities. Booker T. Washington and Anna Cooper believed in the education of blacks being the stepping sto ne for the rise of the race. The biggest difference between these two books was Washington focused on the African American races as a whole, while Cooper focused on elevating the females. In the case of Booker T. Washington, I feel given the situation and the time at which it occurred, I would have probably followed along the lines of his idea of education than that of Mr. Du Bois. Anna Coopers efforts to raise the education of the black women hasnt gone unnoticed. It brought a sense of pride and respect form The African American women As did Washingtons campaignTheater